SoFunction
Updated on 2025-04-09

Resolve that element-ui reset resetFields does not take effect

Initialize data

data() {
	  return {
	  	   dialogVisible: false,
	       form: {
	           name: '',
	           age: '',
	           sex: '',
	           birth: '',
	           addr: ''
	       }
	   }
	}

Pop-up window closes reset data

handleClose() {
    // Clear data when the pop-up window is closed    this.$()
     = false
}

The above operation this.$() does not take effect. Directly force change the value, and the dead horse is a living horse doctor.

Initialize data

data() {
	  return {
	  	   dialogVisible: false,
	       form: {
	           name: '',
	           age: '',
	           sex: '',
	           birth: '',
	           addr: ''
	       },
	       resetForm: {
	       	   name: '',
	           age: '',
	           sex: '',
	           birth: '',
	           addr: ''
	       }
	   }
	}

Pop-up window closes reset data

handleClose() {
    // Clear data when the pop-up window is closed     = 
     = false
}

This is the end of this article about the solution of element-ui reset resetFields() not taking effect. For more related contents of element-ui reset resetFields() not taking effect, please search for my previous articles or continue to browse the related articles below. I hope everyone will support me in the future!