Vue page loading, flashing problem?

  <div class="currency">
    <div v-if="flag==true">
    <span v-cloak>{{(type.ico}}</span> 
    <span>USD</span>
    </div>
    <div v-if="flag==false">
      <span v-cloak>{{(type1.price}}</span> 
      <!-- <span :percent="88"></span>   -->
      <span>RMB</span>
    </div>
    <p @click="switchChange">

</div> v-ifNaNv-cloak
Mar.06,2021

write some styles in css in addition to the v-cloak declaration. Own Baidu


  1. isn't there something wrong with your js logic in NaN? The one that cannot be transferred to "Number" has been converted into Number, and NaN has appeared.
  2. v-cloak under a single file component is unnecessary and will not be useful. I don't know if you are a single file component.

< div vMuthififteen answer type1.price'vshow = "flag==true" >
well, I finally used a method to force it, which is a little disgusting, and the effect has been achieved. I still hope there is a better way

.
Menu