vue计算属性

77 阅读1分钟

vue计算属性如何传参

{{buttonText('3')}}
computed: {
    buttonText() {
      return function(val) {
        if(val === '0') {
          return '审核中'
        }else if(val === '2') {
          return '通过'
        } else if (val === '3') {
          return '驳回'
        } else {
          return '未提交'
        }
      }
    }
  },