1. v-bind: can bind some data to the attributes of the element<div id="app"> <p v-bind:title="message" v-bind:id="pId">I am a p tag</p> </div> <script src="./js/vue.js"></script> <script> let vm = new Vue({ el:"#app", data:{ message: "I am the title value of the p tag", pId: "This is a random ID" } }) The output is: 2. v-bind: can be abbreviated as: It is recommended to write the colon directly<div id="app"> <p :title="message" :id="pId">I am a p tag</p> </div> <script src="./js/vue.js"></script> <script> let vm = new Vue({ el:"#app", data:{ message: "I am the title value of the p tag", pId: "This is a random ID" } }) The output is the same as above 3. v-bind: splicing of instruction expressions,
Without quotes:
Add quotes: <p title="200" :title="message" :id="pId+'This is the additional id'">I am the p tag</p> Output: This is the end of this article about the use of You may also be interested in:
|
<<: CSS style does not work (the most complete solution summary in history)
>>: Example of customizing the style of the form file selection box
Recently, I have done a simple study on the data ...
We all know that we can use the mkdir command to ...
In the previous article, I introduced the functio...
Import: Due to project requirements, we will enca...
1.1 Copy the nginx installation package and insta...
You can have the best visual design skills in the...
Ping www.baidu.com unknown domain name Modify the...
--When connecting to the database, the matching r...
nvm nvm is responsible for managing multiple vers...
Install ZLMediaKit on centos6 The author of ZLMed...
1. Download, I take 8.0 as an example Download ad...
Related Articles: Website Design for User Experien...
After installing Docker on the Linux server, Pull...
If you want to adjust the size and number of Inno...
background Solving browser compatibility issues i...