Solve the problem that the code load is so slow that the code is garbled — Vue


Vue.js solves the problem of starting code loading, which leads to garbled code

Vue.js can solve this problem by several lines of code


[v-cloak] {
            display: none;


After use, it will wait for the Vue to load before rendering the effect, and the code will not appear in the view.

Several basic Vue APIs are introduced.

Bind CSS Style:


.done {
            text-decoration: line-through;
            color: #ccc;



V-bind: class = “{done style: This is in the style: This is some of the items to filter, and items. Done are the true choices}”

Click event:

V-on: Click = “write an event here”

@Click = same as above

const app = new Vue({
                el: '#app',
                data: {
                    todoText: ''
                methods: {
                    handleAddTodoClick() {

Bind key:

This is bound return.

There’s a chance to write something else later.

Recommended Today

Configure pits encountered by IIS

There is a little trouble in maintaining the old projects recently. The old projects of the company are all front-end and back-end, which are not separated. Net development needs to cooperate with IIS for maintenance. Configuration is a back-end thing, but the front-end still needs to know something Pit 1: failed to load file or […]