其他分享
首页 > 其他分享> > antd a-select 获取选中得label

antd a-select 获取选中得label

作者:互联网

html 需要在标签上加属性 labelInValue :

<a-select labelInValue
placeholder="请选择市"
v-decorator="['cityCode', validatorRules.cityCode]"
@change="onchangeCity"

js 获取得时候 value.label 即可获取到了:
onchangeCity(value) {
this.model.cityCode = value.key
this.model.cityName = value.label.replace(/\ /g,"").replace(/\s/g,"")//去掉空格和 \n

标签:cityCode,value,replace,onchangeCity,antd,model,label,select
来源: https://blog.51cto.com/zhaoyingyatou/2581576