v-cloak does not work in vue.js?

前端 未结 6 1577
半阙折子戏
半阙折子戏 2020-12-13 06:24

There is a div in my page that for show the error message.When I refresh the page,it will appear for a while then it disappear. I added v-cloak but

6条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-13 06:45

    Vue.js - 2.3.4, I added the v-cloak on the app container, adding this on the parent container, I find your not repeating the code keeping it DRY.

    HTML:

    Anything inside gets the v-cloak

    CSS:

    [v-cloak] {
     display:none;
    }
    

    Codepen Example:

    • https://codepen.io/Frontend/pen/RjoKQm

提交回复
热议问题