The first one is to use jQuery's ajax to send a request When a user registers, a listener can be used to determine whether the user name is repeated. The listener uses watch. If you need to monitor the change of a value, put the value in the watch. Get the new value, call the interface, request the backend, and determine whether the username already exists. At this point, the problem encountered is that the listener is not triggered when the user refreshes the page, but only when the username value changes. The improvement method is to change the method format listener to an object format listener. The method-format listener is recommended first (the simplest). If it needs to be executed once when it is refreshed, it is defined as an object listener. When an object has multiple attributes, we must use object-format monitoring. If any attribute change of the required object can trigger the listener, the deep attribute must be enabled. When the object has multiple properties, turn on deep:true. If you want to monitor changes in a sub-property of an object, use the following syntax: Summarize: This is the end of this article about the use cases of vue listeners. For more information about the use of vue listeners, please search for 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:
|
<<: Tomcat Nginx Redis session sharing process diagram
>>: MySQL database advanced query and multi-table query
introduction Xiao A was writing code, and DBA Xia...
1. MySql Architecture Before introducing the stor...
Add secure_file_priv = ' '; then run cmd ...
MySQL reports an error when executing multi-table...
In the process of product design, designers always...
Table of contents 1. How to use mixin? 2. Notes o...
1. Enter the command mysqld --skip-grant-tables (...
Implementation ideas The outermost is a big circl...
Method 1: Adding values Let's go to MDN to se...
This article summarizes the common commands for L...
Intersection Selector The intersection selector i...
I believe everyone knows HTML and CSS, knows the ...
Table of contents Row-Column Conversion Analyze t...
Table of contents 1. Understanding Queues 2. Enca...
Description of the phenomenon: The project uses s...