连接后台模糊查询

34 阅读1分钟

image.png suggestions1: [], <el-autocomplete v-model="bizData.deviceCode" :fetch-suggestions="getSuggestions1" placeholder="模糊查询" @select="handleSelect1" >

         getSuggestions1(keyword, cb) {
  this.$api
    .queryDeviceCode(keyword)
    .then((res) => {
      if (res.code == 0) {
        this.suggestions1 = res.data;
        cb(this.suggestions1);
      } else {
        this.suggestions1 = [];
      }
    })
    .catch((err) => {});
},
handleSelect1(item) {
  this.bizData.deviceCode = item;
},