antd a-select 获取选中得label

时间:2021-01-04 11:51:32   收藏:0   阅读:274
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

原文:https://blog.51cto.com/zhaoyingyatou/2581576

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!