diff --git a/src/action-bar-icon/index.tsx b/src/action-bar-icon/index.tsx index f07acaa3a..d562ddfcd 100644 --- a/src/action-bar-icon/index.tsx +++ b/src/action-bar-icon/index.tsx @@ -1,4 +1,4 @@ -import { createNamespace } from '../utils'; +import { createNamespace, UnknownProp } from '../utils'; import { ACTION_BAR_KEY } from '../action-bar'; // Composition @@ -19,7 +19,7 @@ export default createComponent({ icon: String, color: String, badge: [Number, String], - iconClass: null, + iconClass: UnknownProp, }, setup(props, { slots }) { diff --git a/src/action-sheet/index.tsx b/src/action-sheet/index.tsx index 93a761779..5cc001473 100644 --- a/src/action-sheet/index.tsx +++ b/src/action-sheet/index.tsx @@ -17,7 +17,7 @@ export type ActionSheetAction = { loading?: boolean; disabled?: boolean; callback?: (action: ActionSheetAction) => void; - className?: any; + className?: unknown; }; export default createComponent({ diff --git a/src/cell/index.tsx b/src/cell/index.tsx index 0f1fdf30a..c03db1543 100644 --- a/src/cell/index.tsx +++ b/src/cell/index.tsx @@ -1,7 +1,7 @@ -import { PropType } from 'vue'; +import { PropType, CSSProperties } from 'vue'; // Utils -import { createNamespace, isDef } from '../utils'; +import { createNamespace, isDef, UnknownProp } from '../utils'; // Composition import { useRoute, routeProps } from '../composables/use-route'; @@ -23,10 +23,10 @@ export const cellProps = { isLink: Boolean, required: Boolean, iconPrefix: String, - titleStyle: null as any, - titleClass: null as any, - valueClass: null as any, - labelClass: null as any, + valueClass: UnknownProp, + labelClass: UnknownProp, + titleClass: UnknownProp, + titleStyle: (null as unknown) as PropType, arrowDirection: String as PropType, border: { type: Boolean, diff --git a/src/checkbox-group/index.tsx b/src/checkbox-group/index.tsx index 42adf3ade..9c5afd285 100644 --- a/src/checkbox-group/index.tsx +++ b/src/checkbox-group/index.tsx @@ -19,7 +19,7 @@ export type CheckboxGroupToggleAllOptions = export type CheckboxGroupProvide = CheckerParent & { props: { max: number | string; - modelValue: any[]; + modelValue: unknown[]; }; updateModelValue: (value: unknown[]) => void; }; @@ -32,7 +32,7 @@ export default createComponent({ iconSize: [Number, String], checkedColor: String, modelValue: { - type: Array as PropType, + type: Array as PropType, default: () => [], }, }, diff --git a/src/checkbox/Checker.tsx b/src/checkbox/Checker.tsx index 1bc97cd5e..a9b3dabf5 100644 --- a/src/checkbox/Checker.tsx +++ b/src/checkbox/Checker.tsx @@ -1,5 +1,5 @@ import { ref, computed, defineComponent, PropType } from 'vue'; -import { addUnit } from '../utils'; +import { addUnit, UnknownProp } from '../utils'; import Icon from '../icon'; export type CheckerShape = 'square' | 'round'; @@ -15,10 +15,10 @@ export type CheckerParent = { }; export const checkerProps = { - name: null as any, + name: UnknownProp, disabled: Boolean, iconSize: [Number, String], - modelValue: null as any, + modelValue: UnknownProp, checkedColor: String, labelPosition: String as PropType, labelDisabled: Boolean, diff --git a/src/checkbox/index.tsx b/src/checkbox/index.tsx index 49bfc4846..c40ced507 100644 --- a/src/checkbox/index.tsx +++ b/src/checkbox/index.tsx @@ -54,7 +54,7 @@ export default createComponent({ if (parent && props.bindGroup) { return parent.props.modelValue.indexOf(props.name) !== -1; } - return props.modelValue; + return !!props.modelValue; }); const toggle = (newValue = !checked.value) => { diff --git a/src/checkbox/test/__snapshots__/index.spec.ts.snap b/src/checkbox/test/__snapshots__/index.spec.ts.snap index ea5d33613..3d6979609 100644 --- a/src/checkbox/test/__snapshots__/index.spec.ts.snap +++ b/src/checkbox/test/__snapshots__/index.spec.ts.snap @@ -4,6 +4,7 @@ exports[`should adjust label position when using label-position prop 1`] = `