In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you what are the differences between vue interpolation expressions and v-text instructions, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
{{message}} syntax can only be used in tag content
{{}} this syntax is called an interpolation expression, and any legal js expression can be written in the interpolation expression
1. Use plug-in expressions
Using plug-in expressions, there is a content flicker problem, but v-text does not flicker
{{message}}
Let vm = new Vue ({el: "# app", data: {message: "hello vue"}})
In the above code, the results are consistent if the output is normal.
However, if the network speed is slow, the plug-in expression will be output on the page first.
{{message}}
The page is then rendered normally, which is not good enough for the user experience.
two。 Using v-cloak to solve flicker problems in plug-in expressions [v-cloak]: {display:none;} {{message}}
We can use the v-cloak property to hide it at run time, but because vue automatically deletes the v-cloak property at the end of the run
So this method can be used to solve the flicker problem.
3. Plug-in expression
Plug-in expressions will only insert content and will not overwrite the original content, while v-text will overwrite the original content
-{{message}}
/ /-hello vue---- 1234556
/ / hello vue let vm = new Vue ({el: "# app", data: {message: "hello vue"}) these are all the contents of the article "what's the difference between vue interpolation expressions and v-text instructions". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.