写v-if判断异步数据是否加载
<div v-if="seller.supports" class="suppor-count" @click="show">
  <span class="count">{{seller.supports.length}}</span>
  <span class="icon-keyboard_arrow_right"></span>
</div>
<div v-show="detailShow" class="detail"></div>

@click="方法名"绑定click事件


script

export default { 
  props: {                  //异步数据
    seller: {
      type: Object
    }
  },
  data() {              
    return {
      detailShow: false          //默认值
    };
  },
  methods: {
    show() {
      this.detailShow = true;         //show方法
    }
  },

Logo

前往低代码交流专区

更多推荐