The v-once directive is a Vue.js directive that is used to avoid unwanted re-renders of an element. It treats the element as a static content after rendering it once for the first time. This improves performance as it does not have to be rendered again. First, we will create a div element with the id of choice. The v-once directive is then applied to this element to make it render only once.
Parameters: This function does not accept any parameter.
Example: This example uses Vue.js to show the working of the data with v-once.
Please Login to comment...