页面中不添加  :key 索引的时候,会不停的提示虚线,但不影响使用 后来加了一个索引,加成了:key= "content" 从后台取出来的contents是一个list,里面有多条content记录, content对象中会有id,name,等属性 这时候,也不影响使用,但是控制台console中会不停的出现提示 [Vue warn]: Avoid using non-primitive value as key 意思是不要绑对象数组啥的啊, 用元素或者String类型啊 然后就改了…
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "openFlag" 此错误出现的原因是:vue设计是单向数据流,数据的…
今天在做Vue的时候,子组件关闭的时候,报如下错误 报错:vue.esm.js?65d7:610 [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being m…
[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: 'mode' 这个错误是我在子组件里操作父组件传过来的值时报的错,看了官方文档说要…
一.报错截图 [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead, use a data or computed property based on the prop's value. Prop being mutated: "zinum" 报错代码 <!DOCTYPE htm…
<!DOCTYPE html><html><head> <meta charset="utf-8"> <title>Vue 循环为选中的li列表添加效果</title></head><style> li{ list-style: none; } .active { background: rgba(135, 135, 135, 0.74); width: 20%; color: #eee;…
_ 阅读目录 一. 什么是Vue组件? 如何注册组件? 1.1 全局注册组件 1.2 局部注册组件 二:组件之间数据如何传递的呢? 1) props 2) $emit 3) 使用$ref实现通信 4) $attrs 和 $listeners 及 inheritAttrs 5) 理解 provide 和 inject 用法 6) 理解使用bus总线 三:在vue源码中注册组件是如何实现的呢? 在Vue中,组件是一个很强大的功能,组件可以扩展HTML元素,封装可重用的代码.比如在页面当中的某一个部分…
一.为什么学习vue.js vue.js兼具angular.js和react的优点,并且剔除了他们的缺点 官网:http://cn.vuejs.org/ 手册:http://cn.vuejs.org/v2/api/ 二.vue.js是什么 Vue是一个"MVVM框架(库)",和angular类似,相比angular小巧,比较容易上手 Vue是一个构建用户界面点的渐进式框架,与其他重量级框架不同的是,vue采用自底向上增量开发的设计 vue的核心库"只关注视图层",并…
一.sorted面试题 面试题: [11, 33, 4, 2, 11, 4, 9, 2] 去重并保持原来的顺序 答案1: list1 = [11, 33, 4, 2, 11, 4, 9, 2] ret = set(list1) list2 = [] for i in list1: if i not in list2: list2.append(i) print(list2) 执行输出:[11, 33, 4, 2, 9] 答案2: list1 = [11, 33, 4, 2, 11, 4, 9,…
开发中遇到要加载10个或者更多的,类型相同的组件时,如果用普通的 import 引入组件,components注册组件,代码显得太啰嗦了,这时候就需要用到 require.context 动态加载这些组件,然后用循环的方式引用. 这里以三个组件为例: Bus.vue  Car.vue Train.vue. 第一步 在相同目录下新建index.js文件,如下: 第二步 index.js内容如下: const resultComps = {} let requireComponent = requi…