一、功能介绍:

当数据为空时,按钮不可用,当数据不为空时,按钮可用。

二、代码实现:

<span class="expand-value"><Button size="small" :disabled="isdisabledFn" @click="admiss">查看照片</Button></span>
data() {
    return {
      disabled: false,
    };
  },
computed: {
    isdisabledFn() {
      if (this.row.touristimg_url === null || this.row.touristimg_url === '') {
        this.disabled = true;
      } else if (this.row.touristimg_url !== null) {
        this.disabled = false;
      }
      return this.disabled;
    },
  },

 

相关文章:

  • 2022-12-23
  • 2021-10-05
  • 2021-11-17
  • 2022-12-23
  • 2022-03-07
  • 2021-06-07
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
相关资源
相似解决方案