Complete the code to render static content only once using Vue's directive.
<div [1]> <p>This content will not update.</p> </div>
The v-once directive tells Vue to render the element and its children only once, skipping future updates.
Complete the code to apply v-once to a component's root element.
<template>
<section [1]>
<h1>Welcome</h1>
</section>
</template>Applying v-once on the root element ensures the whole section renders only once.
Fix the error in the code to correctly use v-once on a list item.
<ul> <li v-for="item in items" [1]>{{ item.name }}</li> </ul>
Using v-once on each list item renders them once and skips updates, which is useful for static lists.
Fill both blanks to create a static list where each item renders only once.
<ul> <li v-for="item in items" :key="BLANK_1" {{BLANK_2}}>{{ item.text }}</li> </ul>
Using :key="item.id" helps Vue track list items, and v-once ensures each item renders only once.
Fill all three blanks to optimize static content rendering with v-once and unique keys.
<template>
<div>
<article v-for="post in posts" :key="BLANK_1" [2]>
<h2>{{ post.title }}</h2>
<p>{{ post.content }}</p>
</article>
<footer>{{BLANK_3}}</footer>
</div>
</template>Use post.id as a unique key, v-once to render articles once, and display the current year in the footer.