摘要: 1.watch监听普通类型的数据: data() { return { frontPoints: 0 } }, watch: { frontPoints(newValue, oldValue) { console.log(newValue) } } 2.watch监听数组类型 的数据 data() 阅读全文
posted @ 2021-03-28 11:42 艾尔熙得 阅读(4798) 评论(0) 推荐(0)
摘要: 在main.js中加上以下代码 // 添加请求拦截器 axios.interceptors.request.use(config => { // 在发送请求之前做些什么 //判断是否存在token,如果存在将每个页面header都添加token //if中的值为登陆时存入vuex中的token值 / 阅读全文
posted @ 2021-03-12 21:37 艾尔熙得 阅读(1485) 评论(0) 推荐(1)
摘要: 使用element的导航菜单,渲染数据后,重复点击菜单会报错 在\src\router\index.js文件中加入 //获取原型对象上的push函数 const originalPush = Router.prototype.push //修改原型对象中的push方法 Router.prototyp 阅读全文
posted @ 2021-03-12 21:27 艾尔熙得 阅读(144) 评论(0) 推荐(0)