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
/******************** * Application of linked lis...
Usage of time difference functions TIMESTAMPDIFF ...
Preface This article mainly introduces the releva...
Prerequisites A cloud server (centOS of Alibaba C...
How to implement the "Set as homepage" ...
Look at the code first Copy code The code is as fo...
This article records the detailed process of down...
Docker is an open source project that provides an...
If you're collecting information from your us...
Preface This article mainly introduces the method...
--Homepage backup 1.txt text 2. Scan the image 3. ...
In tomcat, jsp is not garbled, but html Chinese i...
MySQL query not using index aggregation As we all...
yum install httpd php mariadb-server –y Record so...
Database read-write separation is an essential an...