Skip to content
Related Articles

Related Articles

Vue.js v-pre Directive
  • Last Updated : 18 Aug, 2020

The v-pre directive is a Vue.js directive used to skip compilation for this element and all its children. You can use this for displaying raw mustache tags. First, we will create a div element with id as app and let’s apply the v-pre directive to an element. Further, we can use a heading element to show the data.



Parameters: This directive doesn’t accept any parameter.

Example: This example uses Vue.js to show the working of v-pre directive.


<!DOCTYPE html>
        VueJS | v-pre directive
    <!-- Load Vuejs -->
    <script src=
    <div style="text-align: center;width: 600px;">
        <h1 style="color: green;">
            VueJS | v-pre directive
    <div id="canvas" style=
        "border:1px solid #000000;
        width: 600px;height: 200px;">
        <div id="app" style="text-align: center; 
                    padding-top: 40px;">
            <h1 v-pre>{{ data }}</h1>
        var app = new Vue({
            el: '#app',
            data: {
                data: 'Hello'



My Personal Notes arrow_drop_up
Recommended Articles
Page :