摘要:
原文链接:基于vue-router的matched实现面包屑功能 阅读全文
posted @ 2022-07-08 18:26
rainbow70626
阅读(86)
评论(0)
推荐(0)
摘要:
框架:vue-cli(vue脚手架) 例:以cdn引入腾讯防水墙为例 前因:在html的head中引入外部cdn链接, 在vue文件中直接使用,如图 结果:如图报错 解决办法: 1. 在index.html中的head中引入, 2.在webpack.base.conf.js中配置 module.ex 阅读全文
posted @ 2022-07-08 18:25
rainbow70626
阅读(1020)
评论(0)
推荐(0)
摘要:
两者的区别 (1)this.$store.commit() commit: 同步操作 this.$store.commit('方法名',值)【存储】 this.$store.state.方法名【取值】 (2)this.$store.dispatch() dispatch: 异步操作 this.$st 阅读全文
posted @ 2022-07-08 17:30
rainbow70626
阅读(523)
评论(0)
推荐(0)
摘要:
import store from "./store" computed: { useName: function() { return store.state.userName } } mapState 函数返回的是一个对象。我们如何将它与局部计算属性混合使用呢? 通常,我们需要使用一个工具函数将 阅读全文
posted @ 2022-07-08 17:01
rainbow70626
阅读(449)
评论(0)
推荐(0)
摘要:
let matched = this.$route.mached.filter(item => item.name);方法报错:TypeError Cannot read properties of undefined (reading 'filter')。 原因分析: 这个问题不要慌,要么是打错字 阅读全文
posted @ 2022-07-08 12:36
rainbow70626
阅读(5429)
评论(0)
推荐(0)
摘要:
router.addRouters()方法报错:Uncaught (in promise) TypeError: router.default.addRouters is not a function。 原因分析: 新版VueRouter废除了addRoutes();//添加的数组 改为addRou 阅读全文
posted @ 2022-07-08 12:04
rainbow70626
阅读(1719)
评论(0)
推荐(0)

浙公网安备 33010602011771号