ElemeFE / element

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

[bug report] TimePicker time picker and problems when using forms #19819

Open jinhuiWong opened 4 years ago

jinhuiWong commented 4 years ago

Element UI version

2.13.2

OS/Browsers version

chrome 81

Vue version

2.6.11

Reproduction Link

https://codepen.io/jinhuiwong/pen/rNxKNGj

Steps to reproduce

随便选择时间,然后重置表单。这时候控件就不可用了

What is Expected?

表单重置后时间段选择控件不可用

What is actually happening?

表单重置后时间段选择控件仍然正常可用

element-bot commented 4 years ago

Translation of this issue:

Element UI version

2.13.2

OS/Browsers version

chrome 81

Vue version

2.6.11

Reproduction Link

https://codepen.io/jinhuiwong/pen/rNxKNGj

Steps to reproduce

Choose the time and reset the form. The control is no longer available

What is Expected?

The time period selection control is not available after the form is reset

What is actually happening?

The time period selection control is still available after the form is reset

Kellercai commented 4 years ago

https://github.com/ElemeFE/element/blob/bf534d977eeecfe0de82397f2598f96f45b7885a/packages/form/src/form-item.vue#L239-L243

这里主要是由于重置数据的时候,如果赋值之后的元素是数组,强制将其初始化为数组。溯源https://github.com/ElemeFE/element/pull/3840

已提交PR https://github.com/ElemeFE/element/pull/19863

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jinhuiWong commented 3 years ago

捞起

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.