Join the Stack Overflow Community
Stack Overflow is a community of 6.5 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

maybe this is a trivial question.

so, when I run my vuejs application on browser with enables throttling download speed (sets to low connection). I got unfinished vue syntax output in browser.

Vue js syntax appear in browser

I know we can trick this out with showing loading image before entire page has loaded, but it's there any best solution to fix this?

share|improve this question
up vote 13 down vote accepted

You can use the v-cloak directive, which will hide the vue instance until the compilation finishes

share|improve this answer
    
in api says : [v-cloak] { display: none; } <div v-cloak> {{ message }} </div> it means, I should add v-cloak attribute in every element that I I wish to hide ? – antoniputra Mar 23 at 20:27
3  
Just to the main App div should be fine – Jeff Mar 23 at 20:33
    
@Jeff ah, I've just aware of it. well v-cloak seems a best answer. thanks @Gus !! – antoniputra Mar 23 at 20:36

I attached the following codepen. You can see the difference with and without v-cloak.

<div id="js-app">
[regular]Hold it... <span>{{test}}</span><br/>
[cloak]Hold it... <span v-cloak>{{test}}</span>
</div>

http://codepen.io/gurghet/pen/PNLQwy

share|improve this answer
1  
yeah I got it... thanks, your codepen would be help for the new comers. – antoniputra May 11 at 16:11
    
you still get the first {{test}} whilst vuejs is loading so its not a perfect answer – twigg Dec 9 at 11:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.