javascriptwebvue.jscdnsinglepage

How to hide vue js code when reload page?


I have a webpage application coded with Vue when reload page the code of Vue in the HTML load with code view and hide.

I need to hide this code when reload page

<script src="cdn.jsdelivr.net/npm/vue"></script> <script src="cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> <script src="./js/vue.js"></script> 

image of what happen when reload page


Solution

  • Take a look at v-cloak, it is a directive to prevent this behavior.

    In your css file you add this:

    [v-cloak] {
      display: none;
    }
    

    And for the text you add the v-cloak attribute

    <div v-cloak>
      {{ message }}
    </div>