How to hide vue js code when reload page?

做~自己de王妃 提交于 2019-12-08 08:15:32

问题


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> 


回答1:


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>


来源:https://stackoverflow.com/questions/53498962/how-to-hide-vue-js-code-when-reload-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!