From e84c4051f36ba6e156e92cd283fe298a7008f41c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=AA=E5=BF=86?= <1455668754@qq.com> Date: Mon, 3 Jun 2024 17:33:50 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20destroy=E6=96=B9=E6=B3=95=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Loading/src/createLoading.ts | 6 +++--- src/components/Loading/src/useLoading.ts | 4 ++-- src/directives/loading.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/Loading/src/createLoading.ts b/src/components/Loading/src/createLoading.ts index d7819df7..8c885418 100644 --- a/src/components/Loading/src/createLoading.ts +++ b/src/components/Loading/src/createLoading.ts @@ -1,4 +1,4 @@ -import { VNode, defineComponent, createVNode, render, reactive, h } from 'vue'; +import { createVNode, defineComponent, h, reactive, render, VNode } from 'vue'; import type { LoadingProps } from './typing'; import Loading from './Loading.vue'; @@ -41,7 +41,7 @@ export function createLoading(props?: Partial, target?: HTMLElemen target.appendChild(vm.el as HTMLElement); } - function destory() { + function destroy() { container && render(null, container); container = vm = null; } @@ -53,7 +53,7 @@ export function createLoading(props?: Partial, target?: HTMLElemen vm, close, open, - destory, + destroy, setTip: (tip: string) => { data.tip = tip; }, diff --git a/src/components/Loading/src/useLoading.ts b/src/components/Loading/src/useLoading.ts index 910e084e..97e7c718 100644 --- a/src/components/Loading/src/useLoading.ts +++ b/src/components/Loading/src/useLoading.ts @@ -1,5 +1,5 @@ -import { unref } from 'vue'; import type { Ref } from 'vue'; +import { unref } from 'vue'; import { tryOnUnmounted } from '@vueuse/core'; import { createLoading } from './createLoading'; import type { LoadingProps } from './typing'; @@ -47,7 +47,7 @@ export function useLoading( }; tryOnUnmounted(() => { - instance.destory(); + instance.destroy(); }); return [open, close, setTip]; diff --git a/src/directives/loading.ts b/src/directives/loading.ts index 242816b5..ead64927 100644 --- a/src/directives/loading.ts +++ b/src/directives/loading.ts @@ -1,5 +1,5 @@ import { createLoading } from '@/components/Loading'; -import type { Directive, App } from 'vue'; +import type { App, Directive } from 'vue'; const loadingDirective: Directive = { mounted(el, binding) { @@ -28,7 +28,7 @@ const loadingDirective: Directive = { } }, unmounted(el) { - el?.instance?.destory(); + el?.instance?.destroy(); }, }; From 95abe061072b79dca9cbba405ebc1f2f66ca6bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=AA=E5=BF=86?= <1455668754@qq.com> Date: Mon, 29 Jul 2024 15:11:06 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20Echarts=E5=88=9D=E5=A7=8B=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6=E7=9B=91=E5=90=AC=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/web/useECharts.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hooks/web/useECharts.ts b/src/hooks/web/useECharts.ts index c5478d79..6eac15f9 100644 --- a/src/hooks/web/useECharts.ts +++ b/src/hooks/web/useECharts.ts @@ -1,8 +1,8 @@ import type { EChartsOption } from 'echarts'; import type { Ref } from 'vue'; +import { computed, nextTick, ref, unref, watch } from 'vue'; import { useTimeoutFn } from '@vben/hooks'; import { tryOnUnmounted, useDebounceFn } from '@vueuse/core'; -import { unref, nextTick, watch, computed, ref } from 'vue'; import { useEventListener } from '@/hooks/event/useEventListener'; import { useBreakpoint } from '@/hooks/event/useBreakpoint'; import echarts from '@/utils/lib/echarts'; @@ -49,6 +49,10 @@ export function useECharts( listener: resizeFn, }); removeResizeFn = removeEvent; + + const resizeObserver = new ResizeObserver(resizeFn); + resizeObserver.observe(el); + const { widthRef, screenEnum } = useBreakpoint(); if (unref(widthRef) <= screenEnum.MD || el.offsetHeight === 0) { useTimeoutFn(() => { @@ -64,7 +68,7 @@ export function useECharts( useTimeoutFn(() => { setOptions(unref(getOptions)); resolve(null); - }, 30); + }, 50); } nextTick(() => { useTimeoutFn(() => { From 56c5dce99f8285f3ca13d18e6c8bd139d27313ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=AA=E5=BF=86?= <1455668754@qq.com> Date: Mon, 29 Jul 2024 15:14:07 +0800 Subject: [PATCH 3/4] =?UTF-8?q?feat:=20ApiSelect=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Form/src/components/ApiSelect.vue | 68 +++++++++++++++++-- 1 file changed, 62 insertions(+), 6 deletions(-) diff --git a/src/components/Form/src/components/ApiSelect.vue b/src/components/Form/src/components/ApiSelect.vue index df59336d..8a444e15 100644 --- a/src/components/Form/src/components/ApiSelect.vue +++ b/src/components/Form/src/components/ApiSelect.vue @@ -3,6 +3,7 @@ @dropdown-visible-change="handleFetch" v-bind="$attrs" @change="handleChange" + @search="debounceSearchFn" :options="getOptions" v-model:value="state" > @@ -20,26 +21,37 @@ +