diff --git a/packages/types/src/utils.ts b/packages/types/src/utils.ts index 80435fc9972..b8ed226a035 100644 --- a/packages/types/src/utils.ts +++ b/packages/types/src/utils.ts @@ -26,7 +26,7 @@ type NonNullable = T extends null | undefined ? never : T; /** * 字符串类型对象 */ -type Recordable = Record; +type Recordable = Record; /** * 字符串类型对象(只读) diff --git a/src/components/Form/src/BasicForm.vue b/src/components/Form/src/BasicForm.vue index bcc11105777..89e6f4fcdad 100644 --- a/src/components/Form/src/BasicForm.vue +++ b/src/components/Form/src/BasicForm.vue @@ -43,7 +43,7 @@ import type { Ref } from 'vue'; import { defineComponent, reactive, ref, computed, unref, onMounted, watch, nextTick } from 'vue'; - import { Form, Row } from 'ant-design-vue'; + import { Form, Row, type FormProps as AntFormProps } from 'ant-design-vue'; import FormItem from './components/FormItem.vue'; import FormAction from './components/FormAction.vue'; @@ -112,7 +112,9 @@ }; }); - const getBindValue = computed(() => ({ ...attrs, ...props, ...unref(getProps) })); + const getBindValue = computed( + () => ({ ...attrs, ...props, ...unref(getProps) }) as AntFormProps, + ); const getSchema = computed((): FormSchema[] => { const schemas: FormSchema[] = unref(schemaRef) || (unref(getProps).schemas as any); @@ -303,7 +305,10 @@ formActionType: formActionType as any, setFormModel, getFormClass, - getFormActionBindProps: computed(() => ({ ...getProps.value, ...advanceState })), + getFormActionBindProps: computed( + () => + ({ ...getProps.value, ...advanceState }) as InstanceType['$props'], + ), fieldsIsAdvancedMap, ...formActionType, }; diff --git a/src/components/Form/src/components/ApiTree.vue b/src/components/Form/src/components/ApiTree.vue index fb9b37bf2c5..16bfc402f3c 100644 --- a/src/components/Form/src/components/ApiTree.vue +++ b/src/components/Form/src/components/ApiTree.vue @@ -79,7 +79,7 @@ if (!isArray(result)) { result = get(result, props.resultField); } - treeData.value = (result as Recordable[]) || []; + treeData.value = (result as (Recordable & { key: string | number })[]) || []; isFirstLoaded.value = true; emit('options-change', treeData.value); } diff --git a/src/components/Table/src/components/editable/CellComponent.ts b/src/components/Table/src/components/editable/CellComponent.ts index 547940b3ecc..934b479e4bd 100644 --- a/src/components/Table/src/components/editable/CellComponent.ts +++ b/src/components/Table/src/components/editable/CellComponent.ts @@ -1,4 +1,4 @@ -import type { FunctionalComponent, defineComponent } from 'vue'; +import type { defineComponent } from 'vue'; import type { ComponentType } from '../../types/componentType'; import { componentMap } from '/@/components/Table/src/componentMap'; @@ -13,7 +13,7 @@ export interface ComponentProps { getPopupContainer?: Fn; } -export const CellComponent: FunctionalComponent = ( +export const CellComponent = ( { component = 'Input', rule = true, diff --git a/src/components/Transition/src/CreateTransition.tsx b/src/components/Transition/src/CreateTransition.tsx index d12518de8e5..035a34a64f3 100644 --- a/src/components/Transition/src/CreateTransition.tsx +++ b/src/components/Transition/src/CreateTransition.tsx @@ -23,8 +23,8 @@ export function createSimpleTransition(name: string, origin = 'top center 0', mo }, }, setup(props, { slots, attrs }) { - const onBeforeEnter = (el: HTMLElement) => { - el.style.transformOrigin = props.origin; + const onBeforeEnter = (el: Element) => { + (el as HTMLElement).style.transformOrigin = props.origin; }; return () => { diff --git a/src/components/Tree/src/TreeIcon.ts b/src/components/Tree/src/TreeIcon.ts index dd4eab1158a..67e2e7b1b9d 100644 --- a/src/components/Tree/src/TreeIcon.ts +++ b/src/components/Tree/src/TreeIcon.ts @@ -1,9 +1,9 @@ -import type { VNode, FunctionalComponent } from 'vue'; +import type { VNode } from 'vue'; import { h } from 'vue'; import { isString } from 'lodash-es'; import Icon from '@/components/Icon/Icon.vue'; -export const TreeIcon: FunctionalComponent = ({ icon }: { icon: VNode | string }) => { +export const TreeIcon = ({ icon }: { icon: VNode | string }) => { if (!icon) return null; if (isString(icon)) { return h(Icon, { icon, class: 'mr-1' }); diff --git a/src/components/Tree/src/components/TreeHeader.vue b/src/components/Tree/src/components/TreeHeader.vue index cb269f53e76..1cbee0b6ad2 100644 --- a/src/components/Tree/src/components/TreeHeader.vue +++ b/src/components/Tree/src/components/TreeHeader.vue @@ -34,7 +34,14 @@