fix: select diabled not work
parent
f6953dc9a7
commit
59440f9207
|
@ -74,7 +74,7 @@ export default defineComponent({
|
||||||
size={fullscreen ? undefined : 'small'}
|
size={fullscreen ? undefined : 'small'}
|
||||||
class={`${prefixCls}-year-select`}
|
class={`${prefixCls}-year-select`}
|
||||||
onChange={this.onYearChange}
|
onChange={this.onYearChange}
|
||||||
value={String(year)}
|
value={year}
|
||||||
options={options}
|
options={options}
|
||||||
getPopupContainer={() => this.calendarHeaderNode}
|
getPopupContainer={() => this.calendarHeaderNode}
|
||||||
></Select>
|
></Select>
|
||||||
|
|
|
@ -6,12 +6,18 @@ function convertNodeToOption(node: VNode): OptionData {
|
||||||
const {
|
const {
|
||||||
key,
|
key,
|
||||||
children,
|
children,
|
||||||
props: { value, ...restProps },
|
props: { value, disabled, ...restProps },
|
||||||
} = node as VNode & {
|
} = node as VNode & {
|
||||||
children: { default?: () => any };
|
children: { default?: () => any };
|
||||||
};
|
};
|
||||||
const child = children.default ? children.default() : undefined;
|
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(
|
export function convertChildrenToData(
|
||||||
|
|
Loading…
Reference in New Issue