javascript / beginner
Snippet
Static Content with v-once
The v-once directive renders the element and component only once. After the initial render, Vue skips updates for this element, improving performance.
snippet.js
javascript
1
2
3
<span v-once>This will never change: {{ staticLabel }}</span>
vue
Breakdown
1
v-once
Tells Vue to treat this element as static after the first render.