问题
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