diff --git a/components/select/demo/label-in-value.vue b/components/select/demo/label-in-value.vue index 3bf2dff80..d28ec2312 100644 --- a/components/select/demo/label-in-value.vue +++ b/components/select/demo/label-in-value.vue @@ -31,11 +31,6 @@ The label of the selected item will be packed as an object for passing to the on import type { SelectProps } from 'ant-design-vue'; import { defineComponent, ref } from 'vue'; -interface Value { - value?: string; - label?: string; -} - export default defineComponent({ setup() { const options = ref([ @@ -48,11 +43,11 @@ export default defineComponent({ label: 'Lucy (101)', }, ]); - const handleChange = (value: Value) => { + const handleChange: SelectProps['onChange'] = value => { console.log(value); // { key: "lucy", label: "Lucy (101)" } }; return { - value: ref({ value: 'lucy' }), + value: ref({ value: 'lucy' }), options, handleChange, }; diff --git a/components/select/demo/option-label-prop.vue b/components/select/demo/option-label-prop.vue index b9813ebcf..5647a4db0 100644 --- a/components/select/demo/option-label-prop.vue +++ b/components/select/demo/option-label-prop.vue @@ -10,10 +10,13 @@ title: 使用 `optionLabelProp` 指定回填到选择框的 `Option` 属性。 +或者使用 `tagRender` 插槽自定义渲染节点 + ## en-US Spacified the prop name of Option which will be rendered in select box. +or use `tagRender` slot for custom rendering of tags.