1.1.6
Windows 8/Chrome 56
2.1.10
http://jsfiddle.net/0bsw8uta/1/
Create any form without validation rules and call resetFields
The fields should get reset to empty values
Nothing happens. The reset works only if there are validation rules attached(even empty dummy ones)
Validation rules are not required for resetFields to work. You just need to add the prop
attribute on el-form-item
: http://jsfiddle.net/0bsw8uta/2/
Thank you. I thought adding prop needed validation rules. If you don't mind me asking, what is the purpose of the prop field?
https://github.com/ElemeFE/element/blob/dev/packages/form/src/form-item.vue#L151
https://github.com/ElemeFE/element/blob/dev/packages/form/src/form-item.vue#L24
You can see it for yourself :)
Most helpful comment
Validation rules are not required for resetFields to work. You just need to add the
prop
attribute onel-form-item
: http://jsfiddle.net/0bsw8uta/2/