desktop-nicemusic icon indicating copy to clipboard operation
desktop-nicemusic copied to clipboard

这儿是不是没必要用计算属性,应该是定义一个函数就好了

Open HuRuilin opened this issue 2 years ago • 0 comments

1、 txt 只是一个函数传参,并不是一个单独定义得响应式变量,此处不需要用到计算属性,感觉有些多余了

 <span
              @click="openDesc(detail.name, detail.description)"
              class="flex-row"
              v-if="txtLength(detail.description) > 50"
              >全部<i
                class="iconfont niceiconfontyoujiantou-copy-copy-copy-copy"
              ></i
            ></span>
computed: {
    txtLength () {
      return function (txt) {
        if (txt) {
          return txt.length
        }
      }
    }
  }

HuRuilin avatar Jun 26 '22 14:06 HuRuilin