Skip to content

Commit 96476b1

Browse files
authored
Merge pull request #7 from wanghansong/bugfix-select
fix: fix options data change but not rerender
2 parents 12dc8b6 + f305afb commit 96476b1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/components/src/select/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,16 @@ const SelectOption = defineComponent({
3131
default: () =>
3232
options.map((option: any) => {
3333
if (typeof option === 'string') {
34-
return h(ElOption, { value: option, label: option }, slots)
34+
return h(
35+
ElOption,
36+
{ key: option, value: option, label: option },
37+
slots
38+
)
3539
} else {
3640
return h(
3741
ElOption,
3842
{
43+
key: option.value,
3944
...option,
4045
},
4146
slots

0 commit comments

Comments
 (0)