Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Vue 3 v-pre Directive

Vue 3 v-pre Directive

Vue3 Built-in Directives Vue 3 Built-in Directives


v-pre The directive is used to skip compilation, not performing Vue template parsing on the element and its children.


Basic Explanation

v-pre The directive tells Vue to skip compiling this element and all its children. Elements with v-pre are rendered as raw HTML, without Vue template syntax processing.


Use Cases

1. Display Raw Mustache Tags

v-pre is most commonly used to display the raw {{ }} syntax:

Example

Output result:



正常渲染: Hello Vue

不编译显示: {{ message }}


Vue3 Built-in Directives Vue 3 Built-in Directives