Home >Web Front-end >Vue.js >How to use label label in vue
The use of label labels in Vue
The role of label labels
label labels are used in Vue to provide form elements (such as input box, radio button, or checkbox) provides clickable text labels. When the user clicks on the label, it automatically triggers the event handler of the associated form element.
Usage
Using the label tag is very simple, just add the following HTML code to your Vue template:
<code class="html"><label for="username">用户名:</label> <input type="text" id="username" v-model="username"></code>
In the example above Medium: The
for
attribute associates the label label with the form element with id="username"
. v-model="username"
event handler of the input box. Attributes
label label has the following common attributes:
Best Practices
The above is the detailed content of How to use label label in vue. For more information, please follow other related articles on the PHP Chinese website!