diff --git a/src/checkbox/Checker.tsx b/src/checkbox/Checker.tsx index 59c77b5e3..b8551fb03 100644 --- a/src/checkbox/Checker.tsx +++ b/src/checkbox/Checker.tsx @@ -5,6 +5,15 @@ import Icon from '../icon'; export type CheckerShape = 'square' | 'round'; export type CheckerLabelPosition = 'left' | 'right'; +type CheckerParent = { + props: { + disabled?: boolean; + iconSize?: number | string; + direction?: 'horizontal' | 'vertical'; + checkedColor?: string; + }; +}; + export const checkerProps = { name: null as any, disabled: Boolean, @@ -23,7 +32,7 @@ export default defineComponent({ props: { ...checkerProps, role: String, - parent: Object as PropType | null>, + parent: Object as PropType, checked: Boolean, bindGroup: { type: Boolean, @@ -40,13 +49,13 @@ export default defineComponent({ setup(props, { emit, slots }) { const iconRef = ref(); - const getParentProp = (name: string) => { + const getParentProp = (name: T) => { if (props.parent && props.bindGroup) { return props.parent.props[name]; } }; - const disabled = computed( + const disabled = computed( () => getParentProp('disabled') || props.disabled ); diff --git a/src/collapse/test/index.spec.js b/src/collapse/test/index.spec.js index cf1c55ef2..9a45ad852 100644 --- a/src/collapse/test/index.spec.js +++ b/src/collapse/test/index.spec.js @@ -176,7 +176,7 @@ test('should toggle collapse after calling the toggle method in accordion mode', setup() { const itemA = ref(); const itemB = ref(); - const active = ref([]); + const active = ref(''); return { itemA, itemB, @@ -194,6 +194,7 @@ test('should toggle collapse after calling the toggle method in accordion mode', }); wrapper.vm.itemA.toggle(); + await later(); expect(wrapper.vm.active).toEqual('a'); wrapper.vm.itemB.toggle(); diff --git a/src/coupon/index.tsx b/src/coupon/index.tsx index 796253d84..e69a50bb5 100644 --- a/src/coupon/index.tsx +++ b/src/coupon/index.tsx @@ -100,7 +100,6 @@ export default createComponent({

{validPeriod.value}

{!disabled && (