VUE之如何获取select的节点文本
<template><a-select labelInValue :defaultValue="{ key: 'lucy' }" style="width: 120px" @change="handleChange"><a-select-option value="jack">Jack (100)</a-select-option>...
·
<template>
<a-select labelInValue :defaultValue="{ key: 'lucy' }" style="width: 120px" @change="handleChange">
<a-select-option value="jack">Jack (100)</a-select-option>
<a-select-option value="lucy">Lucy (101)</a-select-option>
</a-select>
</template>
<script>
export default {
methods: {
handleChange(value) {
console.log(value); // { key: "lucy", label: "Lucy (101)" }
}
}
}
</script>
参考网址:https://vue.ant.design/components/select-cn/#components-select-demo-automatic-tokenization
更多推荐
已为社区贡献7条内容
所有评论(0)