Y
Y
Yura Komarov2020-05-28 21:56:42
Vue.js
Yura Komarov, 2020-05-28 21:56:42

How to not see {{variable}} when loading page of vue site?

Hello.
On the page, vue is connected using inline-template and when the page loads, I always see curly braces for the variable until vue works and replaces them with what it has sewn into the component.
I tried to deal with this by adding a class with display none but that doesn't work out very well.
Tell me who, how to deal with this.
Thank you all in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stepan Krapivin, 2020-05-28
@Yurajun

you can try to do it in a tricky way
in html, set the v-cloak attribute to tags, inside of which there are "brackets" {{

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

and in styles write this:
[v-cloak] {
    display: none;
}

when Vue loads and picks up the layout, it will remove the v-cloak and the display:none style will automatically be removed

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question