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

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

[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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值