uniapp uview WeChat applet reset form resetFields does not take effect

1. Problem description

uniapp + uview click the reset button, the reset does not take effect

this.$refs.form.resetFields();

insert image description here

2. Solve

The reason why it doesn't work is unknown, but we can simulate a reset.
First blank the bound data in the form, and then blank the verification result.

reset() {
	// this.$refs.form.resetFields();
	this.form.name = '';
	this.form.email = '';
	this.form.password = '';
	this.form.confirmPassword = '';
	this.form.phone = '';
	this.form.code = '';
	this.$refs.form.clearValidate();   //清空校验结果
}

Guess you like

Origin blog.csdn.net/honeymoon_/article/details/128624869