Vue 页面错误
3792274 opened this issue · comments
Mr.TianShu commented
yu-jiang-24 commented
大佬,请问一下,你🈶️解决嘛?这个BUG
povs2012 commented
element-ui版本更新导致的,可以回退到2.15.6版本就不报错了
yu-jiang-24 commented
感谢感谢 ,我试试
Nap Chen commented
element-ui版本更新导致的,可以回退到2.15.6版本就不报错了
我的就是2.15.6,访问user页面也同样有这个warning
Randolph Chin commented
参考21905
// ElemeFE/element#21905
// 解决 Instead, use a data or computed property based on the prop's value. Prop being mutated: "placement"
main.js 添加如下即可解决
function RepairProps(cmp) {
(cmp.mixins || []).forEach(mixin => {
if (mixin.props && mixin.props.placement) {
const defaultValue = mixin.props.placement.default
mixin.data = new Proxy(mixin.data, {
apply(target, thisArg, argArray) {
const res = Reflect.apply(target, thisArg, argArray)
return {
...(res || {}),
placement: defaultValue
}
}
})
delete mixin.props.placement
}
if (mixin.mixins && mixin.mixins.length > 0) {
RepairProps(mixin)
}
})
}
RepairProps(Element.DatePicker)
RepairProps(Element.TimePicker)
RepairProps(Element.TimeSelect)