Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the use of the v-once instruction in Vue

Shulou Source: shulou.com Published: 2022-06-01 03:45:34 09月22日 Update

This post is about what the v-once command in Vue does. Xiaobian thinks it is quite practical, so share it with everyone for reference. Let's follow Xiaobian and have a look.

v-once

v-once associated instances are rendered only once. After rerendering, the instance and all its children are treated as static content skips, which can be used to optimize update performance.

This will never change:{{msg}} //single element//has child elements comment

{{msg}}

//Component {{i}}

In the example above, msg,list is not rerendered even if it changes.

Thank you for reading! About "Vue v-once command what to use" this article is shared here, I hope the above content can be of some help to everyone, so that everyone can learn more knowledge, if you think the article is good, you can share it to let more people see it!

Tags: Content instructions elements examples more articles good practical examples individual performance articles see knowledge components static faceted relevance reference help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Redmi Apple vpn Shulou Information