template中:
<Input v-model.trim="tagData.name" :search="true" enter-button size="small" class="fr mar-r16 wd-20P" @on-search="() => this.getUserFn(tagData.name)"/>
 
methods中:
getUserFn (item) {
  // console.log(item)
  let name = this.$route.params.name
  this.$api.ceph(this.zone).getUser(name)
    .then(res => {
      console.log(res)
      let array = []
      if (item == ('' || null)) {
        this.tagData = res.data.data
      }else {
        let arr = res.data.data
        for (let i=0; i<arr.length; i++) {
        // console.log(arr[i].name)
        if (arr[i].name.indexOf(item)>-1) {
          // console.log(arr[i])
          array.push(arr[i])
        }
     }
     this.tagData = array
    }
  })
  .catch()
}

相关文章:

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