当前位置:网站首页>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
边栏推荐
- 2023年第六届亚太应用数学与统计学国际会议(AMS 2023)
- 米哈游--测试开发提前批
- MATLAB三维绘图命令plot3入门
- 2022-08-03:以下go语言代码输出什么?A:2;B:3;C:1;D:0。 package main import “fmt“ func main() { slice := []i
- Demand analysis of MES management system in electronic assembly industry
- RSS订阅微信公众号初探-feed43
- 现货白银需要注意八大事项
- 搭建好pytorch环境后,pip和conda指令不能用
- The Beijing E-sports Metaverse Forum was successfully held
- LeetCode 19:删除链表的倒数第 N 个结点
猜你喜欢
随机推荐
typescript50 - type specification between cross types and interfaces
nodeJs--async/await
第1章:初识数据库与MySQL----MySQL安装
ES6高级-迭代器与生成器的用法
通过whl安装第三方包
Sqlnet. Ora file with the connection of authentication test
typescript55 - generic constraints
js函数防抖和函数节流及其使用场景
LeetCode 19:删除链表的倒数第 N 个结点
FPGA按键消抖+蜂鸣器
查看CUDA、pytorch等的版本号
孙宇晨受邀参加36氪元宇宙峰会并发表主题演讲
易动纷享--测试实习生视频面试
米哈游--测试开发提前批
绕任意轴旋转矩阵推导
DataBinding下的RecycleView适配器Adapter基类
【面经】被虐了之后,我翻烂了equals源码,总结如下
typescript52 - simplify generic function calls
因为一次bug的教训,我决定手撕Nacos源码(先撕客户端源码)
BioVendor人Clara细胞蛋白(CC16)Elisa试剂盒检测步骤









