微信小程序中van-tabs的active不生效?微信小程序中van-tabs的active不生效? 阿贵2022-11-072686浏览问题模块: 开放讨论问题active设置了不生效,一直为0,始终选择第一个回答关注问题邀请回答 收藏 分享 1 个回答 拾忆 2022-11-07 有用 回复 请登录 后发表内容 相关问题 active fail android....
原因 坑的问题在于:van-tabs,里面的v-model默认值是0,但是类型却写着 number | string 。 但是,在此时用缓存赋值给 v-model = " active " 的时候,active的值需要是number类型,才有效,否则再怎么设置都是无效的。 方案 这里active的值需要是number类型 onLoad: function(option) {const type = option.type |...
5.4 配置默认选中项和 tabbar的数据源 data:{active:0,"list":[{"pagePath":"pages/home/home","text":"首页","iconPath":"/images/tabs/home.png","selectedIconPath":"/images/tabs/home-active.png"},{"pagePath":"pages/message/message","text":"消息","iconPath":"/images/tabs/message.png","...