ant design vue a-select 获取下拉菜单选中的option对象
a-select 获取下拉菜单选中的option对象或者option的指定属性值
·
<!-- template中的代码 -->
<a-select
style="width: 100%"
v-model="formData.channelId"
:getPopupContainer="trigger => trigger.parentNode"
:placeholder="i18nRender('form.selectPlaceholder') + i18nRender('newsapp.config.tabbarTable.sourceChannel')"
@change="channelChange"
>
<a-select-option v-for="item in channels" :key="item.uuid" :value="item.uuid" :channel="item">
{{ item.name }}
</a-select-option>
</a-select>
<-- methods 中方法 -->
// 单选
channelChange(value, option) {
console.log(option);
this.formData.channelId = value;
this.selectedChannel = option.data.attrs.channel;
}
更多推荐
已为社区贡献3条内容
所有评论(0)