a-select动态设置默认值后,text 不刷新问题解决
需要将选项设置写入钩子中!
示例如下:
<a-col :xl="6" :lg="7" :md="8" :sm="24" style="width: 200px;">
a-form-item label="效期预警">
a-select v-model="queryParam.xqflag" :options="queryParam.xqoptions" > a-select>
a-form-item>
<a-col>
data() { return {
queryParam: { labid: !!this.labid ? this.labid : "",
itemid: !!this.itemid ? this.itemid : "",
xqflag: !!this.$route.params.xqflag ? this.$route.params.xqflag:"",
xqoptions: [ { value: '', label: '请选择' },
{ value: '1', label: '过期化学品' },
{ value: '10', label: '近效期10天' },
{ value: '15', label: '近效期15天' },
{ value: '30', label: '近效期30天' },
{ value: '60', label: '近效期60天' },
{ value: '90', label: '近效期90天' },
]},
}
}