代码之家  ›  专栏  ›  技术社区  ›  fefe

vue v-show不会在数据属性更改时触发

  •  0
  • fefe  · 技术社区  · 7 年前

    我有以下vue模板

    <button :disabled=isDisabled v-show="!isLast " type="button" id="next" class="survey-card__actions-right" v-on:click="next()">Next {{isLast}}</button>
    <button v-show="isLast " class="survey-card__actions-right" type="button" v-on:click="sendSurvey()">Send</button>
    

          data() {
                return {
                    isLast: false
               }
            }
    

    我有一个下一个方法,检查以下内容

          if(next[0].length == (cI + 2)) {
              alert() //will alert
              this.isLast = true
              console.log(this.isLast) //true
          }
    

    0 回复  |  直到 7 年前