Skip to content

Commit 59440f9

Browse files
committed
fix: select diabled not work
1 parent f6953dc commit 59440f9

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

components/calendar/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export default defineComponent({
7474
size={fullscreen ? undefined : 'small'}
7575
class={`${prefixCls}-year-select`}
7676
onChange={this.onYearChange}
77-
value={String(year)}
77+
value={year}
7878
options={options}
7979
getPopupContainer={() => this.calendarHeaderNode}
8080
></Select>

components/vc-select/utils/legacyUtil.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,18 @@ function convertNodeToOption(node: VNode): OptionData {
66
const {
77
key,
88
children,
9-
props: { value, ...restProps },
9+
props: { value, disabled, ...restProps },
1010
} = node as VNode & {
1111
children: { default?: () => any };
1212
};
1313
const child = children.default ? children.default() : undefined;
14-
return { key, value: value !== undefined ? value : key, children: child, ...restProps };
14+
return {
15+
key,
16+
value: value !== undefined ? value : key,
17+
children: child,
18+
disabled: disabled || disabled === '', // support <a-select-option disabled />
19+
...restProps,
20+
};
1521
}
1622

1723
export function convertChildrenToData(

0 commit comments

Comments
 (0)