摘要: runtimeCompiler: true, // 如果路由中的component 不是组件时候,是'<template></template>' ;需要设置为true 阅读全文
posted @ 2020-06-10 20:20 Running00 阅读(157) 评论(0) 推荐(0) 编辑
摘要: //变化监听 watch: { $route() { // } } 路由不存在适合,重定向到A对应的路由 { path: '*', redirect: A } 路由未匹配到时候展示A组件 { path: '*', component: A } 阅读全文
posted @ 2020-06-10 20:05 Running00 阅读(105) 评论(0) 推荐(0) 编辑
摘要: 1 去重 var a = [1,2,3,4,5,3,2,3,4,5]; // 去掉重复的项 1 Array.form // Array.from() 方法从一个类似数组或可迭代对象创建一个新的,浅拷贝的数组实例 Array.from(new Set(a)) 注意:并不适合所有的去重情况 var a 阅读全文
posted @ 2020-06-10 17:57 Running00 阅读(95) 评论(0) 推荐(0) 编辑
摘要: this.$options.data() // 初始data的值 this.$data // 当前data的值 阅读全文
posted @ 2020-06-10 17:48 Running00 阅读(1088) 评论(0) 推荐(0) 编辑
摘要: <template> <div> <Child1 /> <Child2 /> </div> </template> <template> <div @click="child1Click"> child1 </div> </template> // child1 { data() { return 阅读全文
posted @ 2020-06-10 17:04 Running00 阅读(467) 评论(0) 推荐(0) 编辑