当前位置:网站首页>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
边栏推荐
- 状态机实验
- typescript52 - simplify generic function calls
- Justin Sun: Web3.0 and the Metaverse will assist mankind to enter the online world more comprehensively
- 20年将投资美国约2000亿美元,三星电子财大气粗的样子真好看
- 查看CUDA、pytorch等的版本号
- fsdbDump用法
- C # WPF equipment monitoring software (classic) - the next
- 轻量级网络整理及其在Yolov5上的实现
- 新一代服务网关Gateway的实践笔记
- 求解同余方程 数论 扩展欧几里得
猜你喜欢
随机推荐
小身材有大作用——光模块基础知识(一)
【每日一题】899. 有序队列
outputBufferIndex = mDecode.dequeueOutputBuffer(bufferInfo, 0) 一直返回为-1
C语言实验十四 结构体
typescript57-数组泛型接口
手撕Gateway源码,今日撕工作流程、负载均衡源码
新一代服务网关Gateway的实践笔记
搭建好pytorch环境后,pip和conda指令不能用
114. 如何通过单步调试的方式找到引起 Fiori Launchpad 路由错误的原因
机器学习——库
Tanabata festival coming, VR panoramic look god assists for you
Spinnaker调用Jenkins API 返回403错误
"Miscellaneous" barcode by Excel as a string
boot issue
FastDFS 一文读懂
nodeJs--async/await
Node.js的基本使用(三)数据库与身份认证
How to find the cause of Fiori Launchpad routing errors by single-step debugging
手撕Nacos源码,今日撕服务端源码
typescript58-泛型类









