当前位置:网站首页>Vant3 - click on the corresponding name name to jump to the next page corresponding to the location of the name of the TAB bar
Vant3 - click on the corresponding name name to jump to the next page corresponding to the location of the name of the TAB bar
2022-08-04 00:35:00 【Nanchen_42】
Vant—— tab 点击对应的nameThe name jumps to the corresponding one on the next pagetab栏的name的位置
First of all, we need to configure the corresponding data structure for the previous page
这里是通过Pinia去写 ️
myfileStore.ts
<div v-for="(item,index) in store.list" :key="index" @click="onList(item,index)"></div>
const onList = (item: any, index: Number) => {
router.push({
// path: "/IndexFill",
path: item.path,
query:{
name:item.name // put the clickedname传给下一个页面
}
});
};
IndexFill.vue
/* 这里需要把activeNameBind as in the previous pagequery中的name的值 */
<van-tabs v-model:active="activeName" swipeable @change="change">
/* 通过动态nameto get the traverseditem.name即可 */
<van-tab v-for="(item,index) in store.list" :name="item.name" :title="item.title" :key="index">
</van-tab>
</van-tabs>
<script lang='ts'>
import {
useRoute } from "vue-router";
import {
onMounted, ref } from "vue";
import {
myfileStore } from "../store/module/myfileStore"; // Deconstruction just putPinia中的store
export default {
name: "",
setup() {
const store = myfileStore();
const route = useRoute();
const name = route.query;
/* 直接通过refGenerate initializedactiveName */
const activeName = ref(name.name);
// console.log(activeName)
/* vant的滑动事件 */
const change = (name: any) => {
console.log(name);
};
return {
change,
onClickLeft,
activeName,
store,
route,
name,
};
},
};
</script>
A little attention to the dynamic herenameThe list in which to bind the loopname
边栏推荐
猜你喜欢
咱们500万条数据测试一下,如何合理使用索引加速?
c语言分层理解(c语言操作符)
Vant3—— 点击对应的name名称跳转到下一页对应的tab栏的name的位置
Justin Sun was invited to attend the 36氪 Yuan Universe Summit and delivered a keynote speech
研究生新生培训第四周:MobileNetV1, V2, V3
Jmeter cross-platform operation CSV files
【杂项】如何将指定字体装入电脑然后能在Office软件里使用该字体?
【性能优化】MySQL性能优化之存储引擎调优
全面讲解 Handler机制原理解析 (小白必看)
因为一次bug的教训,我决定手撕Nacos源码(先撕客户端源码)
随机推荐
【每日一题】899. 有序队列
nodeJs--async/await
机器学习——库
Linux安装mysql最简单教程(一次成功)
七夕佳节即将来到,VR全景云游为你神助攻
轻量级网络整理及其在Yolov5上的实现
研究生新生培训第四周:MobileNetV1, V2, V3
【详细教程】一文参透MongoDB聚合查询
取模运算(MOD)
小身材有大作用——光模块寿命分析(二)
c语言分层理解(c语言指针(上))
pcl点云数据 转化为 Eigen::Map
数据库扩容也可以如此丝滑,MySQL千亿级数据生产环境扩容实战
分布式事务框架 seata
Nanoprobes 棕榈酰纳米金相关说明书
七夕活动浪漫上线,别让网络拖慢和小姐姐的开黑时间
Apple told Qualcomm: I bought a new campus for $445 million and may plan to speed up self-development of baseband chips
如何通过单步调试的方式找到引起 Fiori Launchpad 路由错误的原因试读版
FPGA按键消抖+蜂鸣器
c语言分层理解(c语言操作符)