fix: select diabled not work

pull/3053/head
tangjinzhou 2020-10-24 23:52:51 +08:00
parent f6953dc9a7
commit 59440f9207
2 changed files with 9 additions and 3 deletions

View File

@ -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}
></Select>

View File

@ -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 <a-select-option disabled />
...restProps,
};
}
export function convertChildrenToData(