From d7965c5857d08dcc56e43ba9f2d0bf2f0af2ef64 Mon Sep 17 00:00:00 2001 From: mtruning <1262327911@qq.com> Date: Sun, 23 Jan 2022 19:22:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/chartEditStore/chartEditStore.ts | 6 +++--- src/utils/plugin.ts | 6 ++++++ src/utils/utils.ts | 7 +++---- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/store/modules/chartEditStore/chartEditStore.ts b/src/store/modules/chartEditStore/chartEditStore.ts index 9b8f152f..ccf08101 100644 --- a/src/store/modules/chartEditStore/chartEditStore.ts +++ b/src/store/modules/chartEditStore/chartEditStore.ts @@ -44,7 +44,7 @@ export const useChartEditStoreStore = defineStore({ }, actions: { // * 设置数据项 - setEditCanvasItem(key: T, value: any) { + setEditCanvasItem(key: T, value: K) { this.editCanvas[key] = value }, // * 设置页面样式属性 @@ -111,7 +111,7 @@ export const useChartEditStoreStore = defineStore({ this.setScale(parseFloat(scaleHeight.toFixed(5))) } } else { - window['$message'].warning('找不到元素') + window['$message'].warning('请先创建画布,再进行缩放') } }, // * 监听缩放 @@ -139,4 +139,4 @@ export const useChartEditStoreStore = defineStore({ } } } -}) +}) \ No newline at end of file diff --git a/src/utils/plugin.ts b/src/utils/plugin.ts index 7944023a..411a8a21 100644 --- a/src/utils/plugin.ts +++ b/src/utils/plugin.ts @@ -10,6 +10,12 @@ import { renderIcon } from '@/utils' * * render 对话框 * @param { Object} params 配置参数 * @param { Function } dialogFn 函数 + * ``` + * // 最简易demo + * goDialog({ + * onPositiveCallback: () => {} + * }) + * ``` */ export const goDialog = ( params: { diff --git a/src/utils/utils.ts b/src/utils/utils.ts index f6a0ad1b..623fb5fc 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -82,13 +82,12 @@ export const screenfullFn = (isFullscreen?: boolean, isEnabled?: boolean) => { * @param key 键名 * @param value 键值 */ -export const setDomAttribute = ( +export const setDomAttribute = ( HTMLElement: HTMLElement, - key: T, - value: any + key: K, + value: V ) => { if (HTMLElement) { - // @ts-ignore HTMLElement.style[key] = value } }