New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug Report] el-date-picker控制台警告:Instead, use a data or computed property based on the prop's value. Prop being mutated: "placement" #21905
Comments
我也遇到了 |
+1 |
2 similar comments
+1 |
+1 |
这个 PR #21806 增加了 props element/packages/date-picker/src/picker.vue Line 583 in 8ab1db8
说白了之前 |
是的 |
提了 PR 等合并了。 |
+1 |
sorry...我的锅...提交的时候没检查仔细...😨 |
怎么解决这个问题呢? |
fallback to 2.15.6npm uninstall element-ui
npm install element-ui@2.15.6 -s |
此 bug 仅存在 2.5.19。因为 placement 仅为内部使用,且仅在 picker 初始化时被修改,其实并不会导致任何问题。 要么就催官方尽快合并 PR #21908 |
锁定版本 安装非2.5.19的版本 |
并不能解决问题 |
可以先回退2.15.8
|
2.15.6也有这个问题,只能回退到2.15.8版本 |
同样的问题 |
临时应急方式 import Vue from 'vue'
import ElementUI from 'element-ui'
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(ElementUI.DatePicker)
RepairProps(ElementUI.TimePicker)
RepairProps(ElementUI.TimeSelect)
Vue.use(ElementUI, {
size: 'medium'
}) |
2.15.6有问题,2.15.8版本修复了,2.15.9又有问题了 |
2.15.9又出现了, |
+1 |
|
2.15.10 已修复 |
1 similar comment
2.15.10 已修复 |
Element UI version
2.15.9
OS/Browsers version
Mac
Vue version
2.6.14
Reproduction Link
https://codepen.io/elanyoung/pen/abqKxqE
Steps to reproduce
打开控制台即可看到警告
What is Expected?
解决控制台警告
What is actually happening?
2.5.18版本没有此警告,更新2.5.19就出现了,placement属性造成的
The text was updated successfully, but these errors were encountered: