iview踩坑
时间:2023-02-08 15:00:00
1 关于树形组件
点击目录实现收缩
return h('span', { style: { display: 'inline-block', width: '90%', }, class:"tree-list", on: { click: () => { ////控制树目录结点 展开收缩 // data.expand = !data.expand data.expand = !data.expand data.expand = !data.expand } } },
2 menu 导航不支持多级嵌套
2.10.1 版已经实现
3 modal 按钮由对话框确定loading 状态 设为假时 对话框会自己消失
setTimeout(function () { _this.loading = false _this.$nextTick(() => {_this.loading = true;}); }, 500)
设为假时 需要这样设置
4 来回切换不同子路 相应的导航菜单不亮,也不展开子项
pdateOpened | 手动更新子目录,注意 $nextTick 里调用 |
$route(to, from) { this.changeVal = this.$route.name; sessionStorage.setItem("changeNav", this.changeVal); this.$nextTick(function() { this.$refs.menu.updateOpened(); this.$refs.menu.updateActiveName(); }); }
5 在实现分页时,切换不同页面显示多少数据 无效(点击后显示未点击前的状态)
点击切换后,隐藏表格显示v-if,换成v-show 可解决
6 iview select 下拉列表 默认值无法设置
通过设置v-model还需要注意动态绑定 默认绑定值和option绑定的值 保持一致
7did you register the component correctly? For recursive components, make sure to provide the "name" option.
这个问题出现了 首先检查您的组件引用是否有问题,然后将子组件注册放在前面
export default{ name:'changePass', components:{ BasePass, }, data (){ return {} }}