ElemeFE / element

A Vue.js 2.0 UI Toolkit for Web
https://element.eleme.io/
MIT License
54.14k stars 14.64k forks source link

[Bug Report] el-date-picker got a problem #21943

Open xingyue234 opened 2 years ago

xingyue234 commented 2 years ago

Element UI version

2.15.9

OS/Browsers version

macOS Big Sur

Vue version

2.7.0-beta.5

Reproduction Link

https://elementui.github.io/issue-generator/#/zh-CN

Steps to reproduce

just copy the same code form element-ui document

What is Expected?

I am not pass the placement props to the component

What is actually happening?

vue.esm.js?a026:628 [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 packages/form/src/form-item.vue at packages/form/src/form.vue at node_modules/zx-layouts/VabQueryForm/VabQueryFormRightPanel.vue at node_modules/zx-layouts/VabQueryForm/index.vue at src/views/business/activity/index.vue at src/layouts/components/VabAppMain/index.vue at src/layouts/index.vue at src/App.vue
joke2k commented 2 years ago

Seems that adding some props for Popper @XivLaw added a prop placement with the same name of data attribute:

https://github.com/ElemeFE/element/blame/dev/packages/date-picker/src/picker.vue#L101

the created() method should be updated removing old vue-popper options:

https://github.com/ElemeFE/element/blame/dev/packages/date-picker/src/picker.vue#L580-L583

XivLaw commented 2 years ago

Seems that adding some props for Popper @XivLaw added a prop placement with the same name of data attribute:

https://github.com/ElemeFE/element/blame/dev/packages/date-picker/src/picker.vue#L101

the created() method should be updated removing old vue-popper options:

https://github.com/ElemeFE/element/blame/dev/packages/date-picker/src/picker.vue#L580-L583

That is my fault,this pr[#21908 ] removed the placement,and fixed this problem.

joke2k commented 2 years ago

@XivLaw the two PR have different approaches, tbh I don't know if is better to remove the prop (#21908 ) or use the currentPlacement data (#21944).

XivLaw commented 2 years ago

Seems that adding some props for Popper @XivLaw added a prop placement with the same name of data attribute: https://github.com/ElemeFE/element/blame/dev/packages/date-picker/src/picker.vue#L101 the created() method should be updated removing old vue-popper options: https://github.com/ElemeFE/element/blame/dev/packages/date-picker/src/picker.vue#L580-L583

That is my fault,this pr[#21908 ] removed the placement,and fixed this problem.

When will the new version be released?

Maybe next week,element team looks like ervery month will merge a new version.

XivLaw commented 2 years ago

@XivLaw the two PR have different approaches, tbh I don't know if is better to remove the prop (#21908 ) or use the currentPlacement data (#21944).

I think removed the prop will be good,because the prop didn't exist before.

devzom commented 2 years ago

Can be resolved by setting fixed version of dependency https://github.com/ElemeFE/element/pull/21908#issuecomment-1181792082