Found invalid `v-once` directivesJS-0638
vue
v-once directive renders the element and component once only. On subsequent re-renders, the element/component and all its children will be treated as static content and skipped. This can be used to optimize update performance.
v-once directive is invalid when :
- The directive has an argument.
- The directive has a modifier.
- The directive has an attribute value.
The issue is fixed by removing the argument, modifier and attribute value.
Bad Practice
<!-- 'v-once' directives require no argument -->
<div v-once:aaa/>
<!-- 'v-once' directives require no modifier -->
<div v-once.bbb/>
<!-- 'v-once' directives require no attribute value -->
<div v-once="ccc"/>
Recommended
<!-- removed modifier, attribute, argument -->
<div v-once/>
References
- Vue2 Guide
v-onceAPI- Cheap Static Components with
v-once