vue3 keep-alive include失效问题

05-14 阅读 0评论

使用vue3 keep-alive时,发现并没有起作用, 代码如下:

vue3 keep-alive include失效问题,vue3 keep-alive include失效问题,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,使用,地址,名称,第1张
(图片来源网络,侵删)
  
    
    
      
    
  
  


import { useLayoutStore } from '../../../stores';
import { storeToRefs } from 'pinia';
const store = useLayoutStore();
const { cachedViews } = storeToRefs(store);


.app-main {
  padding: 10px;
  height: calc(100vh - 90px);
  width: 100%;
}

这里的include绑定的是路由名称的数组,看着没什么问题,就是不起作用。

原来vue3的setup无法组件命名,keep-alive include必须要组件命名

所以在需要添加缓存的组件中,添加:

export default { name: 'charts1' };

这里的charts1就是该组件名,对应路由的name也是charts1。

参考地址:https://blog.csdn.net/guang_sszbs/article/details/123236594

 

vue3 keep-alive include失效问题,vue3 keep-alive include失效问题,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,使用,地址,名称,第2张
(图片来源网络,侵删)
vue3 keep-alive include失效问题,vue3 keep-alive include失效问题,词库加载错误:未能找到文件“C:\Users\Administrator\Desktop\火车头9.8破解版\Configuration\Dict_Stopwords.txt”。,使用,地址,名称,第3张
(图片来源网络,侵删)

免责声明
本网站所收集的部分公开资料来源于AI生成和互联网,转载的目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。
文章版权声明:除非注明,否则均为主机测评原创文章,转载或复制请以超链接形式并注明出处。

发表评论

快捷回复: 表情:
评论列表 (暂无评论,人围观)

还没有评论,来说两句吧...

目录[+]