ZSWYD

使用element-ui遇到 el-date-picker报错。Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders. Instead

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

image
真的是找问题真难,
找半天没找到使用props的地方,,,原来在这里

锁定组件,发现是 el-date-picker 组件抛出的警告。
问题出在了这个 PR #21806 增加了 props placement 用来适应位置,但是之前的代码 created 时有给 placement 赋值。
之前 placement 是 data 的对象,现在变成 props 了

解决方法
npm uninstall element-ui
m install element-ui@2.15.8 -s

posted on 2022-09-14 09:55  苏舒  阅读(659)  评论(0)    收藏  举报

导航