1. Use plugin expressions
<div id="app"> <p> {{message}} </p> <p v-text="message"></p> </div> <script src="./js/vue.js"></script> <script> let vm = new Vue({ el:"#app", data:{ message:"hello vue" } }) </script> In the above code, if the output is normal, the result is consistent. However, if the network speed is slow, the plugin expression will be output on the page first. {{message}} The page will then be rendered normally, which is not good enough for the user experience. 2. Use v-cloak in plugin expressions to solve the flickering problem<style> [v-cloak]: display:none; } </style> <div id="app"> <p v-cloak> {{message}} </p> <p v-text="message"></p> </div> <script src="./js/vue.js"></script> We can use the So this method can be used to solve the flickering problem 3. Plugin Expression Plugin expressions only insert content and do not overwrite the original content, while <div id="app"> <p> ----{{message}}---- </p> //----hello vue---- <p v-text="message">1234556</p> // hello vue </div> <script src="./js/vue.js"></script> <script> let vm = new Vue({ el:"#app", data:{ message:"hello vue" } }) </script> This is the end of this article about the difference between vue interpolation expressions and v-text directives. For more information about the difference between vue interpolation expressions and v-text directives, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Solve the margin: top collapse problem in CCS
>>: Use trigger method to realize pop-up file selection dialog box without clicking file type input
I recently used the MySql database when developin...
Table of contents Too long to read Component styl...
Attribute check-strictly The official document pr...
Sometimes, we want the text boxes in the form to b...
Preface In MySQL, InnoDB belongs to the storage e...
Overview: Oracle scott user has four tables, whic...
1. Install cmake 1. Unzip the cmake compressed pa...
Preface: position:sticky is a new attribute of CS...
Table of contents Overview What is lazy loading? ...
I have always wanted to learn about caching. Afte...
The browser displays TIF format images Copy code T...
Preface This article aims to explain the most bor...
<br />Use of line break tag<br>The lin...
Recently, Xiao Ming just bought a new Mac and wan...
I believe everyone has had this feeling: watching ...