首页 > 其他分享 >[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent c

[Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent c

时间:2022-09-01 09:47:03浏览次数:54  
标签:vue computed value prop ui 报错 element

报错提示:

vue.runtime.esm.js?2b0e:619 [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: "placement"

found in

---> <ElDatePicker> at packages/date-picker/src/picker.vue
<Index> at src/views/demo/index.vue
<App> at src/App.vue
<Root>

报错原因+解决方案:我使用的 ElementUI 版本是 "element-ui": "^2.15.9",会出现这个报错提示,更换一个更低点的版本即可解决报错,不解决报错好像也不影响效果展示,自行【判断】

// 卸载 elementUI 旧版本
npm uninstall element-ui
// 安装新版本版本
npm i element-ui -S
// 安装指定版本 
npm i [email protected] -S

 

标签:vue,computed,value,prop,ui,报错,element
From: https://www.cnblogs.com/huguo/p/16645394.html

相关文章