天天看点

antd select 设置默认选中

<a-select v-model="queryParam.pcId" style="width:300px;">
   <a-select-option v-for="p in pcData" :key="p.id" :value="p.id">{{p.pcName}}</a-select-option>
</a-select>      
queryParam:{pcId:''}, //设置了初始值后正常      
getAction('/list', p).then(res => {
          if (res.success) {
            this.pcData = res.result.records
            if (this.pcData.length > 0) {
              this.queryParam.pcId = this.pcData[0].id
            }
          }
        })