From cc86cbf7bcb367bad8379cdb0625cd944d8aee1d Mon Sep 17 00:00:00 2001 From: tangjinzhou <415800467@qq.com> Date: Sun, 12 Sep 2021 22:08:32 +0800 Subject: [PATCH] style: format --- components/menu/src/SubMenu.tsx | 2 +- components/menu/src/hooks/useMenuContext.ts | 12 +++++------- components/modal/ConfirmDialog.tsx | 2 +- components/table/Table.tsx | 11 ++++++++--- components/vc-table/Cell/index.tsx | 2 +- components/vc-table/Table.tsx | 6 +++--- package.json | 4 ++-- 7 files changed, 21 insertions(+), 18 deletions(-) diff --git a/components/menu/src/SubMenu.tsx b/components/menu/src/SubMenu.tsx index 869d1f1b1..e0c28ff34 100644 --- a/components/menu/src/SubMenu.tsx +++ b/components/menu/src/SubMenu.tsx @@ -231,7 +231,7 @@ export default defineComponent({ return () => { const subMenuPrefixClsValue = subMenuPrefixCls.value; - let baseTitleNode = () => { + const baseTitleNode = () => { const icon = getPropsSlot(slots, props, 'icon'); const expandIcon = props.expandIcon || slots.expandIcon || menuExpandIcon.value; const title = renderTitle(getPropsSlot(slots, props, 'title'), icon); diff --git a/components/menu/src/hooks/useMenuContext.ts b/components/menu/src/hooks/useMenuContext.ts index 86d8a17e6..1acd05e77 100644 --- a/components/menu/src/hooks/useMenuContext.ts +++ b/components/menu/src/hooks/useMenuContext.ts @@ -58,13 +58,11 @@ export interface MenuContextProps { // // Motion motion?: ComputedRef; - defaultMotions?: ComputedRef, className: Ref) => CSSMotionProps); - } - > | null>; + defaultMotions?: ComputedRef, className: Ref) => CSSMotionProps); + }> | null>; // // Popup subMenuOpenDelay: ComputedRef; diff --git a/components/modal/ConfirmDialog.tsx b/components/modal/ConfirmDialog.tsx index 6de31a8c3..b414bc751 100644 --- a/components/modal/ConfirmDialog.tsx +++ b/components/modal/ConfirmDialog.tsx @@ -3,7 +3,7 @@ import type { ModalFuncProps } from './Modal'; import Dialog from './Modal'; import ActionButton from './ActionButton'; import { getConfirmLocale } from './locale'; -import { FunctionalComponent } from 'vue'; +import type { FunctionalComponent } from 'vue'; interface ConfirmDialogProps extends ModalFuncProps { afterClose?: () => void; diff --git a/components/table/Table.tsx b/components/table/Table.tsx index e5c5014e6..e9ce5a048 100644 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -132,10 +132,13 @@ export const tableProps = () => { type: Number as PropType, default: undefined, }, - expandedRowKeys: { type: Array as PropType, default: undefined }, + expandedRowKeys: { + type: Array as PropType, + default: undefined as TableProps['expandedRowKeys'], + }, defaultExpandedRowKeys: { type: Array as PropType, - default: undefined, + default: undefined as TableProps['defaultExpandedRowKeys'], }, expandedRowRender: { type: Function as PropType, @@ -605,6 +608,8 @@ const InteralTable = defineComponent< ({ table, }); return () => { - const columns = (attrs.columns || convertChildrenToColumns(slots.default?.())) as ColumnsType; + const columns = attrs.columns || convertChildrenToColumns(slots.default?.()); return ( { +export interface TableProps { prefixCls?: string; data?: RecordType[]; columns?: ColumnsType; @@ -143,7 +144,7 @@ export interface TableProps { transformCellText?: TransformCellText; } -export default defineComponent({ +export default defineComponent>({ name: 'Table', inheritAttrs: false, props: [ @@ -190,7 +191,6 @@ export default defineComponent({ setup(props, { attrs, slots, emit }) { const mergedData = computed(() => props.data || EMPTY_DATA); const hasData = computed(() => !!mergedData.value.length); - // ==================== Customize ===================== const mergedComponents = computed(() => mergeObject>(props.components, {}), diff --git a/package.json b/package.json index b5c4bfe8a..2815b57fd 100644 --- a/package.json +++ b/package.json @@ -141,9 +141,9 @@ "eslint-config-prettier": "^8.0.0", "eslint-plugin-html": "^6.0.0", "eslint-plugin-jest": "^24.3.6", - "eslint-plugin-markdown": "^2.0.0-alpha.0", + "eslint-plugin-markdown": "^2.0.0", "eslint-plugin-no-explicit-type-exports": "^0.11.10", - "eslint-plugin-prettier": "^3.1.4", + "eslint-plugin-prettier": "^3.1.0", "eslint-plugin-vue": "^7.1.0", "fetch-jsonp": "^1.1.3", "fs-extra": "^10.0.0",