美文网首页
强制刷新组件

强制刷新组件

作者: 落花夕拾 | 来源:发表于2021-02-21 17:34 被阅读0次
    //div
          <component
              v-if="isrefresh"
            :is="modelComponent"
          />
     data() {
        return {
          isrefresh: true,
         modelComponent: ''
        }
      },
     handleTabClick(index) {
          if (this.dataType === index) {
            return;
          }
          this.isrefresh = this.isrefresh ? false : true
          if (this.canGoOn()) {
            this.dataType = index;
            if (index !== 0 ) {
              this.$nextTick(()=>{ //强制刷新组件
                this.isrefresh = this.isrefresh ? false : true
                this.modelComponent = 'datamodel';
              })
            }
          }
        },
    
    

    相关文章

      网友评论

          本文标题:强制刷新组件

          本文链接:https://www.haomeiwen.com/subject/ebmqfltx.html