Problems with delayed rendering of element-ui dialog

just wrote a function is to nest a form in dialog , and then want to reset the form when opening or closing, but because this component is delayed rendering problems lead to how to try now, either Cannot read property "resetFields" of undefined or reset after no effect at all, is there any good way to feel that this thing is good?


add a ref value to the form in html is form , and then:

this.$nextTick(() => {
   this.$refs.form.reset();
})

try this.


can make the form you write into a component. After the delayed loading of the form, emit dispatches an event, and the dialog receives it and executes the method to reset the form.


add a line to the mounted function so that dialog is no longer lazy to load.
this.$refs.yourDiaglog.rendered=true

Menu