When Vue. js is used to display data, the original code is flashed on the page, and vue. js is flashed.
I started to learn how to use Vue. js today, but I found a problem during the learning process, that is, when loading data on the page, the original code will flash. Visit all parties for final solutions.
Step 1: Add a piece of css code
<style type="text/css"> [v-cloak] { display: none; } </style>
Step 2: reference the css module on The view
<div id="app" v-cloak>
Note: In some articles, adding a v-cloak to the specific data section is too troublesome, and each data display must be added. Therefore, you can directly load the view module, the problem can be solved.
Step 3: The js part remains unchanged
<Script type = "text/javascript"> var exeData = {message: "Hello World", name: "I am Vue"}; new Vue ({el: "# app", data: exeData}) </script>
The complete code is shown below:
<! DOCTYPE html>
The above solution uses Vue. when js displays data, the problem of the original code flashing on the page is all the content shared by xiaobian. I hope to give you a reference, and I hope you can provide more support to the customer's house.