diff --git a/components/calendar/Header.tsx b/components/calendar/Header.tsx index 0e8547bd5..8f5290fd9 100644 --- a/components/calendar/Header.tsx +++ b/components/calendar/Header.tsx @@ -74,7 +74,7 @@ export default defineComponent({ size={fullscreen ? undefined : 'small'} class={`${prefixCls}-year-select`} onChange={this.onYearChange} - value={String(year)} + value={year} options={options} getPopupContainer={() => this.calendarHeaderNode} > diff --git a/components/vc-select/utils/legacyUtil.ts b/components/vc-select/utils/legacyUtil.ts index d58ef1a33..2dca628ef 100644 --- a/components/vc-select/utils/legacyUtil.ts +++ b/components/vc-select/utils/legacyUtil.ts @@ -6,12 +6,18 @@ function convertNodeToOption(node: VNode): OptionData { const { key, children, - props: { value, ...restProps }, + props: { value, disabled, ...restProps }, } = node as VNode & { children: { default?: () => any }; }; const child = children.default ? children.default() : undefined; - return { key, value: value !== undefined ? value : key, children: child, ...restProps }; + return { + key, + value: value !== undefined ? value : key, + children: child, + disabled: disabled || disabled === '', // support + ...restProps, + }; } export function convertChildrenToData(