页面中不添加  :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…
<el-select v-model="addform.province" placeholder="请选择省份" multiple>             <el-option               v-for="item in provinces"               :key="item"               :label="item.value"      …
Avoid replacing instance root $data. Use nested data properties instead. 翻译 避免替换实例根$data.请改用嵌套数据属性 错误的代码 const demoData={ name:"小明", age:19 } this.$data=demoData; //此种直接赋值即会导致警告产生(对象的拷贝默认是深拷贝即引用) 产生原因 最新的Vue已经不允许这样直接对跟实例$data进行赋值 解决方案 使用 Object.…
场景:父组件向子组件传递数据,子组件去试图改变父组件数据的时候. 解决:子组件通过事件向父组件传递信息,让父组件来完成数据的更改. 比如:我的父组件是普通页面,子组件是弹窗的登录界面,父组件传递的数据(reloginDialog)控制登录界面的显示(reloginDialog = true),当登陆成功后,子组件触发一个事件,父组件捕获后(reloginDialog = false)将登录界面隐藏. 父组件调用 <re-login :dialogProp="reloginDialog&qu…
项目中遇到父组件传值 activeIndex <Tabs :tabs="tabs" :activeIndex="activeIndex" ></Tabs> <script > export default{ updated(){ let currentRoute=this.$route.name; var arr=Array.from(this.$store.state.app.tabs); if(arr.indexOf(curr…
今天在用element-ui的DatePicker日期选择器的时候,发现每当点击一次这个组件,控制台就会报警告`[Vue warn]: $attrs is readonly`,但是也不影响实际操作效果.网上搜了一圈后,发现是使用的vue与vue-tempalte-compiler的版本不一致造成的.当时使用的vue是最新版本2.6.10,而vue-template-compiler版本是2.5.21. **解决方法:** 降低vue的版本至2.5.21. `npm uninstall vue`…