Problem scenario: Recently, when developing a project, I encountered such a problem: protocolId: { required: true, message: 'Please select the parsing protocol', trigger: 'blur'}, ], This can realize the verification function, but there will be a problem. If the verification condition (submit button) is triggered and an error message is prompted, the error message will still exist even if the data is reselected later, because the submit button is not clicked again to trigger the verification. This user experience is not very good. Solution:1. Check the fields individually Click the Save button to trigger the validation, which generally validates all fields. this.$refs.addForm.validateField('protocolId', (valid) => { //valid returns the error message written in the rule set. If the conditions are met, the return value is empty if (!valid) { return } }) The above code can be executed in a function that confirms data selection, so that this special content is checked again. If it meets the verification rules, the error prompt disappears. 2. Directly clear the prompt information of the field under the form fieldthis.$refs.addForm.clearValidate(); This method is to directly clear the error message without making any judgment. I personally do not recommend it. This concludes this article on how to clear verification prompts for element form validation. For more information on clearing verification prompts for element form validation, please search previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
>>: How does MySQL connect to the corresponding client process?
Preface JavaScript continues to grow and prosper ...
Table of contents Basic Edition Step 1: Configure...
1. Apache static resource cross-domain access Fin...
Table of contents MutationObserver API Features I...
First go to the official website to download and ...
Table of contents Brief summary At noon today, th...
Table of contents summary Problem Description Ana...
The complete syntax of the SELECT statement is: (...
In Dockerfile, run, cmd, and entrypoint can all b...
Go is an open source programming language that ma...
IP masquerading and port forwarding Firewalld sup...
I will explain the installation of MySQL under Wi...
Introduction: When using MySQL to create a table,...
What is margin-top collapse Margin-top collapse i...
Table of contents Preface 1. Style penetration 1....