Skip to content

Commit a3a0600

Browse files
committed
fix: select item display not update
1 parent 36b2d47 commit a3a0600

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

antdv-demo

components/vc-select/Selector/SingleSelector.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import pickAttrs from '../../_util/pickAttrs';
22
import Input from './Input';
33
import { InnerSelectorProps } from '.';
4-
import { computed, defineComponent, ref, VNodeChild, watch } from 'vue';
4+
import { computed, defineComponent, Fragment, ref, VNodeChild, watch } from 'vue';
55
import PropTypes from '../../_util/vue-types';
66

77
interface SelectorProps extends InnerSelectorProps {
@@ -125,7 +125,9 @@ const SingleSelector = defineComponent<SelectorProps>({
125125
{/* Display value */}
126126
{!combobox.value && item && !hasTextInput.value && (
127127
<span class={`${prefixCls}-selection-item`} title={title.value}>
128-
{Array.isArray(item.label) ? item.label.map(la => la) : item.label}
128+
<Fragment key={item.key || item.value}>
129+
{item.label}
130+
</Fragment>
129131
</span>
130132
)}
131133

0 commit comments

Comments
 (0)