摘要:
解决: const originalPush = VueRouter.prototype.push VueRouter.prototype.push = function push(location) { return originalPush.call(this, location).catch( 阅读全文
摘要:
var arr = [ {name:'zopp',age:0}, {name:'gpp',age:18}, {name:'yjj',age:8} ]; function compare(property){ return function(a,b){ var value1 = a[property] 阅读全文
摘要:
let arr=[1,2,3,4]; let arr1=[1,2,3,4,5,6,7,8,"a"]; function array_diff(a, b) { for(let i=0;i<b.length;i++){ for(let j=0;j<a.length;j++){ if(a[j] b[i]) 阅读全文
摘要:
### elementUI中涉及到组件嵌套的时候如何进行传值-slot插槽作用域 ```vue <template> <zujian> <template slot-scope="props"> <p>{{props.row.属性}}</p> </template> </zujian> </temp 阅读全文
摘要:
### 项目搭建 vue create my_cms Babel Router Vuex CSS Use history mode for router? n Sass/SCSS (with dart-sass) In package.json Save this as a preset for f 阅读全文
摘要:
### 拿到登录的token ①api/index.js中添加user接口: user: { login: "/v3/login" }, ②api/request.js中导出 userLoginApi 接口(注意是post方法): export const userLoginApi=(data)=> 阅读全文
摘要:
### ts配置路由 ①安装:npm i vue-router -S ②src下新建pages/Home.vue(还有Goods.vue、Detail.vue等页面): <template> <div class="home"> <h2>首页</h2> </div> </template> <scr 阅读全文
摘要:
### vue-cli创建项目 Babel TypeScript Use class-style component syntax? Yes Use Babel alongside TypeScript (required for modern mode, auto-detected polyfil 阅读全文
摘要:
在函数体内操作某个变量时,如何明确这个变量操作的是全局变量还是局部变量? 向上查找,如果在函数体内找到了与该变量相同的变量名,并且这个变量时局部变量,说明该行操作的变量也是局部变量。 向上查找时,如果在函数体内没有找到和该变量相同名称的变量,继续向函数体外查找,如果找到说明该行操作的变量是全局变量。 阅读全文
摘要:
vue响应式数据的原理-vue最大的特点就是数据驱动视图,vue的数据改变,页面一定发生改变吗?这也不一定。当操作引用类型的数据,动态添加属性时,页面不会发生改变。vue响应式的原理:底层是Object.defineProperty(),目前vue2.6和将来的vue3.0都是通过给data中的数据 阅读全文