v-cloak does not work in vue.js?

前端 未结 6 1581
半阙折子戏
半阙折子戏 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:44

    Unfortunately the above 2 answers didn't work for me as the problem was something else. Since this questions pops up #1 on Google, I thought I'd share my solution.

    If you've defined a display css rule somewhere that's more specific, it will break the v-cloak functionality. However! Do not despair - simply copy this into your CSS file and it will work!

    [v-cloak] .v-cloak--block {
      display: block!important;
    }
    
    [v-cloak] .v-cloak--inline {
      display: inline!important;
    }
    
    [v-cloak] .v-cloak--inlineBlock {
      display: inline-block!important;
    }
    
    [v-cloak] .v-cloak--hidden {
      display: none!important;
    }
    
    [v-cloak] .v-cloak--invisible {
      visibility: hidden!important;
    }
    
    .v-cloak--block,
    .v-cloak--inline,
    .v-cloak--inlineBlock {
      display: none!important;
    }
    

提交回复
热议问题