diff --git a/packages/effects/plugins/src/echarts/echarts.ts b/packages/effects/plugins/src/echarts/echarts.ts index a96850afa..8f3cd71c9 100644 --- a/packages/effects/plugins/src/echarts/echarts.ts +++ b/packages/effects/plugins/src/echarts/echarts.ts @@ -1,6 +1,4 @@ -export type { ECOption } from './types'; - -import { BarChart, LineChart, PieChart, RadarChart } from "echarts/charts"; +import { BarChart, LineChart, PieChart, RadarChart } from 'echarts/charts'; import { DatasetComponent, GridComponent, @@ -8,12 +6,15 @@ import { TitleComponent, ToolboxComponent, TooltipComponent, - TransformComponent -} from "echarts/components"; -import * as echarts from "echarts/core"; -import { LabelLayout, LegacyGridContainLabel, UniversalTransition } from "echarts/features"; -import { CanvasRenderer } from "echarts/renderers"; - + TransformComponent, +} from 'echarts/components'; +import * as echarts from 'echarts/core'; +import { + LabelLayout, + LegacyGridContainLabel, + UniversalTransition, +} from 'echarts/features'; +import { CanvasRenderer } from 'echarts/renderers'; echarts.use([ TitleComponent, @@ -32,5 +33,6 @@ echarts.use([ LegendComponent, ToolboxComponent, ]); +export type { ECOption } from './types'; export default echarts; diff --git a/packages/effects/plugins/src/motion/README.md b/packages/effects/plugins/src/motion/README.md index 7067b379f..03c2ca1e5 100644 --- a/packages/effects/plugins/src/motion/README.md +++ b/packages/effects/plugins/src/motion/README.md @@ -4,12 +4,12 @@ ## 导出 -| 导出 | 类型 | 说明 | -|------|------|------| -| `Motion` | 组件 | 动画组件 | -| `MotionGroup` | 组件 | 动画组组件 | -| `MotionDirective` | 指令 | 动画指令 | -| `MotionPlugin` | 插件 | Vue 插件 | +| 导出 | 类型 | 说明 | +| ----------------- | ---- | ---------- | +| `Motion` | 组件 | 动画组件 | +| `MotionGroup` | 组件 | 动画组组件 | +| `MotionDirective` | 指令 | 动画指令 | +| `MotionPlugin` | 插件 | Vue 插件 | ## 使用 @@ -23,4 +23,4 @@ app.use(MotionPlugin); ```ts import type { MotionOptions, MotionVariants } from '@vben/plugins/motion'; -``` \ No newline at end of file +``` diff --git a/packages/effects/plugins/src/plugins-context.ts b/packages/effects/plugins/src/plugins-context.ts index a8d07e744..459c21343 100644 --- a/packages/effects/plugins/src/plugins-context.ts +++ b/packages/effects/plugins/src/plugins-context.ts @@ -1,6 +1,6 @@ -import type { VbenPluginsOptions } from "./types"; +import type { VbenPluginsOptions } from './types'; -let globalPluginsOptions: VbenPluginsOptions | null = null; +let globalPluginsOptions: null | VbenPluginsOptions = null; export function providePluginsOptions(options: VbenPluginsOptions) { if (!globalPluginsOptions) { @@ -11,15 +11,18 @@ export function providePluginsOptions(options: VbenPluginsOptions) { globalPluginsOptions = { ...globalPluginsOptions, ...options, - form: globalPluginsOptions.form && options.form - ? { ...globalPluginsOptions.form, ...options.form } - : globalPluginsOptions.form || options.form, - modal: globalPluginsOptions.modal && options.modal - ? { ...globalPluginsOptions.modal, ...options.modal } - : globalPluginsOptions.modal || options.modal, - message: globalPluginsOptions.message && options.message - ? { ...globalPluginsOptions.message, ...options.message } - : globalPluginsOptions.message || options.message, + form: + globalPluginsOptions.form && options.form + ? { ...globalPluginsOptions.form, ...options.form } + : globalPluginsOptions.form || options.form, + modal: + globalPluginsOptions.modal && options.modal + ? { ...globalPluginsOptions.modal, ...options.modal } + : globalPluginsOptions.modal || options.modal, + message: + globalPluginsOptions.message && options.message + ? { ...globalPluginsOptions.message, ...options.message } + : globalPluginsOptions.message || options.message, components: { ...globalPluginsOptions.components, ...options.components, diff --git a/packages/effects/plugins/src/vxe-table/README.md b/packages/effects/plugins/src/vxe-table/README.md index 468fe0349..2dfd2b29a 100644 --- a/packages/effects/plugins/src/vxe-table/README.md +++ b/packages/effects/plugins/src/vxe-table/README.md @@ -4,20 +4,24 @@ ## 导出 -| 导出 | 类型 | 说明 | -|------|------|------| -| `setupVbenVxeTable` | 函数 | 初始化配置函数 | -| `useVbenVxeGrid` | 函数 | 表格组合式函数 | -| `VbenVxeGrid` | 组件 | 表格组件 | -| `VxeTableGridColumns` | 类型 | 表格列类型 | -| `VxeTableGridOptions` | 类型 | 表格配置类型 | -| `VxeGridProps` | 类型 | 表格 Props | -| `VxeGridListeners` | 类型 | 表格事件类型 | +| 导出 | 类型 | 说明 | +| --------------------- | ---- | -------------- | +| `setupVbenVxeTable` | 函数 | 初始化配置函数 | +| `useVbenVxeGrid` | 函数 | 表格组合式函数 | +| `VbenVxeGrid` | 组件 | 表格组件 | +| `VxeTableGridColumns` | 类型 | 表格列类型 | +| `VxeTableGridOptions` | 类型 | 表格配置类型 | +| `VxeGridProps` | 类型 | 表格 Props | +| `VxeGridListeners` | 类型 | 表格事件类型 | ## 使用 ```ts -import { setupVbenVxeTable, useVbenVxeGrid, VbenVxeGrid } from '@vben/plugins/vxe-table'; +import { + setupVbenVxeTable, + useVbenVxeGrid, + VbenVxeGrid, +} from '@vben/plugins/vxe-table'; ``` ## 初始化 @@ -39,5 +43,8 @@ setupVbenVxeTable({ ## 类型 ```ts -import type { VxeTableGridOptions, VxeGridProps } from '@vben/plugins/vxe-table'; -``` \ No newline at end of file +import type { + VxeTableGridOptions, + VxeGridProps, +} from '@vben/plugins/vxe-table'; +``` diff --git a/packages/effects/plugins/src/vxe-table/init.ts b/packages/effects/plugins/src/vxe-table/init.ts index d0915dd59..61b6ca77e 100644 --- a/packages/effects/plugins/src/vxe-table/init.ts +++ b/packages/effects/plugins/src/vxe-table/init.ts @@ -1,10 +1,8 @@ -import type { SetupVxeTable } from "./types"; +import type { SetupVxeTable } from './types'; -import { defineComponent, watch } from "vue"; +import { defineComponent, watch } from 'vue'; -import { usePreferences } from "@vben/preferences"; - -import { injectPluginsOptions } from "../plugins-context"; +import { usePreferences } from '@vben/preferences'; import { VxeButton, @@ -19,13 +17,20 @@ import { VxeSelect, VxeTooltip, VxeUI, - VxeUpload -} from "vxe-pc-ui"; -import enUS from "vxe-pc-ui/lib/language/en-US"; // 导入默认的语言 -import zhCN from "vxe-pc-ui/lib/language/zh-CN"; -import { VxeColgroup, VxeColumn, VxeGrid, VxeTable, VxeToolbar } from "vxe-table"; + VxeUpload, +} from 'vxe-pc-ui'; +import enUS from 'vxe-pc-ui/lib/language/en-US'; // 导入默认的语言 +import zhCN from 'vxe-pc-ui/lib/language/zh-CN'; +import { + VxeColgroup, + VxeColumn, + VxeGrid, + VxeTable, + VxeToolbar, +} from 'vxe-table'; -import { extendsDefaultFormatter } from "./extends"; // 是否加载过 +import { injectPluginsOptions } from '../plugins-context'; +import { extendsDefaultFormatter } from './extends'; // 是否加载过 // 是否加载过 let isInit = false; diff --git a/packages/effects/plugins/src/vxe-table/types.ts b/packages/effects/plugins/src/vxe-table/types.ts index 49846b274..4582c8221 100644 --- a/packages/effects/plugins/src/vxe-table/types.ts +++ b/packages/effects/plugins/src/vxe-table/types.ts @@ -1,18 +1,19 @@ import type { VxeGridListeners, - VxeGridProps as VxeTableGridProps, VxeGridPropTypes, - VxeUIExport -} from "vxe-table"; + VxeGridProps as VxeTableGridProps, + VxeUIExport, +} from 'vxe-table'; -import type { Ref } from "vue"; +import type { Ref } from 'vue'; -import type { ClassType, DeepPartial } from "@vben/types"; +import type { ClassType, DeepPartial } from '@vben/types'; -import type { BaseFormComponentType, VbenFormProps } from "@vben-core/form-ui"; -import { useVbenForm } from "@vben-core/form-ui"; +import type { BaseFormComponentType, VbenFormProps } from '@vben-core/form-ui'; -import type { VxeGridApi } from "./api"; +import type { VxeGridApi } from './api'; + +import { useVbenForm } from '@vben-core/form-ui'; export interface VxePaginationInfo { currentPage: number; diff --git a/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue b/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue index ddde3d30a..78cab6a58 100644 --- a/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue +++ b/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue @@ -331,7 +331,7 @@ async function init() { watch( formOptions, () => { - formApi.setState((prev) => { + formApi.setState((prev: Record) => { const finalFormOptions: VbenFormProps = mergeWithArrayOverride( {}, formOptions.value,