v-show 和 v-hasPermi配合后者失效
时间: 2023-11-25 18:47:57 浏览: 105
在使用v-show和v-hasPermi配合时,可能会出现v-hasPermi失效的情况。这是因为v-show只是修改了元素的css样式为隐藏,而并没有移除元素,所以在页面初始化时,v-if判断前两行为true,后两行没有在页面渲染元素,只校验了前两行的v-hasPermi方法。当后面修改了数据状态,v-if后两行为true,但由于页面设置了缓存,根本没有加载v-hasPermi这个方法。因此,建议在使用v-show和v-hasPermi时,将v-if改为v-show即可,这样进入当前列表页就会触发这四行的v-hasPermi方法。
阅读全文
相关推荐
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![doc](https://img-home.csdnimg.cn/images/20241231044833.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![zip](https://img-home.csdnimg.cn/images/20241231045053.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20250102104920.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)