[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”
element ui版本问题
报错提示: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
—> at packages/date-picker/src/picker.vue
at src/views/demo/index.vue
at src/App.vue
解决方案:我使用的 ElementUI 版本是 “element-ui”: “^2.15.8”,会出现这个报错提示,更换一个更低点的版本即可解决报错,不解决报错好像也不影响效果展示
// 卸载 elementUI 旧版本
npm uninstall element-ui
// 安装新版本
npm i element-ui -S
// 安装指定版本
npm i element-ui@2.15.7 -S

本文介绍了一个常见的Vue警告,即直接修改Prop值导致的问题,并提供了解决方案。使用ElementUI版本2.15.8时可能会遇到此警告,通过降级ElementUI版本可以消除该警告。
5万+

被折叠的 条评论
为什么被折叠?



