From f47838e316818aa6f08dca5570e29bced504f309 Mon Sep 17 00:00:00 2001 From: unanmed <1319491857@qq.com> Date: Sun, 15 Nov 2026 17:05:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=89=80=E6=9C=89?= =?UTF-8?q?=E5=86=85=E7=BD=AE=E7=BB=84=E4=BB=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client-base/src/components/background.tsx | 47 +++++++ .../client-base/src/components/input.tsx | 8 +- .../client-base/src/components/list.tsx | 35 +++-- .../client-base/src/components/misc.tsx | 52 ++++--- .../client-base/src/components/scroll.tsx | 128 +++++++++++------- .../client-base/src/components/slider.tsx | 60 +++++--- .../client-base/src/components/textbox.tsx | 22 +-- .../src/components/textboxTyper.ts | 12 +- .../client-base/src/components/tip.tsx | 4 +- 9 files changed, 241 insertions(+), 127 deletions(-) create mode 100644 packages-user/client-base/src/components/background.tsx diff --git a/packages-user/client-base/src/components/background.tsx b/packages-user/client-base/src/components/background.tsx new file mode 100644 index 0000000..f265b4a --- /dev/null +++ b/packages-user/client-base/src/components/background.tsx @@ -0,0 +1,47 @@ +import { SetupComponentOptions } from '@motajs/system'; +import { ElementLocator } from '@motajs/render'; +import { DefaultProps } from '@motajs/render-vue'; +import { computed, defineComponent } from 'vue'; + +export interface BackgroundProps extends DefaultProps { + loc: ElementLocator; + winskin?: ImageIds; + color?: CanvasStyle; + border?: CanvasStyle; +} + +const backgroundProps = { + props: ['loc', 'winskin', 'color', 'border'] +} satisfies SetupComponentOptions; + +/** + * 背景组件,与 Selection 类似,不过绘制的是背景,而不是选择光标,参数参考 {@link BackgroundProps},用例如下: + * ```tsx + * // 使用 winskin2.png 作为背景 + * + * // 使用指定填充和边框颜色作为背景 + * + * ``` + */ +export const Background = defineComponent(props => { + const isWinskin = computed(() => !!props.winskin); + const fixedLoc = computed(() => { + const [x = 0, y = 0, width = 200, height = 200] = props.loc; + return [x + 2, y + 2, width - 4, height - 4]; + }); + + return () => + isWinskin.value ? ( + + ) : ( + + ); +}, backgroundProps); diff --git a/packages-user/client-base/src/components/input.tsx b/packages-user/client-base/src/components/input.tsx index bfe65b0..5846068 100644 --- a/packages-user/client-base/src/components/input.tsx +++ b/packages-user/client-base/src/components/input.tsx @@ -1,4 +1,4 @@ -import { DefaultProps } from '@motajs/render-vue'; +import { DefaultProps, transitionedColor } from '@motajs/render-vue'; import { computed, defineComponent, onUnmounted, ref, watch } from 'vue'; import { TextContent, TextContentProps } from './textbox'; import { @@ -11,8 +11,6 @@ import { IRenderItem, IRenderTreeRoot } from '@motajs/render'; -// @ts-expect-error render/use.ts 按 D-54 留在实现层,本文件已移入系统层,按 D-68 暂以标注记录,不反向引用、不解耦 -import { transitionedColor } from '../use'; import { linear } from '@motajs/animate'; import { SetupComponentOptions } from '@motajs/system'; @@ -71,7 +69,7 @@ const inputProps = { * ( ele.style.height = `${inputHeight}px`; ele.style.font = font.string(); ele.style.color = String(props.fillStyle ?? 'white'); + ele.style.backgroundColor = '#111'; ele.style.zIndex = '100'; + ele.value = value.value; document.body.appendChild(ele); ele.focus(); }; diff --git a/packages-user/client-base/src/components/list.tsx b/packages-user/client-base/src/components/list.tsx index a672345..3070ef6 100644 --- a/packages-user/client-base/src/components/list.tsx +++ b/packages-user/client-base/src/components/list.tsx @@ -1,5 +1,5 @@ import { DefaultProps } from '@motajs/render-vue'; -import { computed, defineComponent, ref, SlotsType, VNode } from 'vue'; +import { computed, defineComponent, ref, SlotsType, VNode, watch } from 'vue'; import { Selection } from './misc'; import { ElementLocator, Font } from '@motajs/render'; import { SetupComponentOptions } from '@motajs/system'; @@ -8,11 +8,11 @@ import { Scroll } from './scroll'; export interface ListProps extends DefaultProps { /** 列表内容,第一项表示 id,第二项表示显示的内容 */ list: [string, string][]; - /** 当前选中的项 */ - selected: string; /** 定位 */ loc: ElementLocator; - /** 每行的高度,默认 18 */ + /** 当前选中的项 */ + selected?: string; + /** 每行的高度,默认 24 */ lineHeight?: number; /** 字体 */ font?: Font; @@ -53,8 +53,8 @@ const listProps = { export const List = defineComponent( (props, { emit }) => { - const selected = ref(props.list[0][0]); - const lineHeight = computed(() => props.lineHeight ?? 18); + const selected = ref(props.selected ?? props.list[0][0]); + const lineHeight = computed(() => props.lineHeight ?? 24); const select = (value: string) => { selected.value = value; @@ -62,6 +62,13 @@ export const List = defineComponent( emit('update:selected', value); }; + watch( + () => props.selected, + value => { + selected.value = value ?? props.list[0][0]; + } + ); + return () => ( {props.list.map((v, i) => { @@ -87,7 +94,11 @@ export const List = defineComponent( 0.5 ]; return ( - select(key)}> + select(key)} + > {selected.value === key && ( ((props, { emit, slots }) => { - const selected = ref(props.selected); + const selected = ref(props.selected ?? props.list[0][0]); const basis = computed(() => props.basis ?? 0.3); const width = computed(() => props.loc[2] ?? 200); @@ -187,10 +198,18 @@ export const ListPage = defineComponent< }); const update = (key: string) => { + selected.value = key; emit('update', key); emit('update:selected', key); }; + watch( + () => props.selected, + value => { + selected.value = value ?? props.list[0][0]; + } + ); + const close = () => emit('close'); return () => ( diff --git a/packages-user/client-base/src/components/misc.tsx b/packages-user/client-base/src/components/misc.tsx index 365e826..158ab0f 100644 --- a/packages-user/client-base/src/components/misc.tsx +++ b/packages-user/client-base/src/components/misc.tsx @@ -3,16 +3,17 @@ import { CustomRenderItem, MotaOffscreenCanvas2D } from '@motajs/render'; -import { DefaultProps, PathProps } from '@motajs/render-vue'; +import { + cycledTransition, + DefaultProps, + onExcitedFunc, + PathProps +} from '@motajs/render-vue'; import { computed, defineComponent, ref, watch } from 'vue'; import { TextContent, TextContentProps } from './textbox'; import { Scroll, ScrollExpose, ScrollProps } from './scroll'; -// @ts-expect-error render/use.ts 按 D-54 留在实现层,本文件已移入系统层,按 D-68 暂以标注记录,不反向引用、不解耦 -import { transitioned } from '../use'; import { SetupComponentOptions } from '@motajs/system'; import { clamp } from 'lodash-es'; -// @ts-expect-error render/renderer 按 D-54 留在实现层,本文件已移入系统层,按 D-59 暂以标注记录,不反向引用、不解耦 -import { using } from '../renderer'; import { cosh, CurveMode } from '@motajs/animate'; interface ProgressProps extends DefaultProps { @@ -29,7 +30,7 @@ interface ProgressProps extends DefaultProps { } const progressProps = { - props: ['loc', 'progress', 'success', 'background'] + props: ['loc', 'progress', 'success', 'background', 'lineWidth'] } satisfies SetupComponentOptions; /** @@ -115,14 +116,15 @@ export const Arrow = defineComponent(props => { path.lineTo(x2 - x, y2 - y); const angle = Math.atan2(y2 - y1, x2 - x1); path.moveTo( - x2 - head * Math.cos(angle - Math.PI / 6), - y2 - head * Math.sin(angle - Math.PI / 6) + x2 - head * Math.cos(angle - Math.PI / 6) - x, + y2 - head * Math.sin(angle - Math.PI / 6) - y ); path.lineTo(x2 - x, y2 - y); path.lineTo( - x2 - head * Math.cos(angle + Math.PI / 6), - y2 - head * Math.sin(angle + Math.PI / 6) + x2 - head * Math.cos(angle + Math.PI / 6) - x, + y2 - head * Math.sin(angle + Math.PI / 6) - y ); + return path; }); @@ -218,22 +220,24 @@ export const ScrollText = defineComponent< const eleHeight = computed(() => props.loc[3] ?? props.width); const pad = computed(() => props.pad ?? 16); - let lastFixedTime = Date.now(); + let lastFixedTime = -1; let lastFixedPos = 0; let paused = false; let nowScroll = 0; - using.onExcitedFunc(() => { + onExcitedFunc(time => { if (paused || !scroll.value) return; - const now = Date.now(); - const dt = now - lastFixedTime; + if (lastFixedTime === -1) { + lastFixedTime = time; + return; + } + const dt = time - lastFixedTime; nowScroll = (dt / 1000) * speed.value + lastFixedPos; scroll.value.scrollTo(nowScroll, 0); if (nowScroll >= scroll.value.getScrollLength()) { emit('scrollEnd'); paused = true; } - lastFixedTime = now; }); const pause = () => { @@ -243,18 +247,18 @@ export const ScrollText = defineComponent< const resume = () => { paused = false; lastFixedPos = nowScroll; - lastFixedTime = Date.now(); + lastFixedTime = -1; }; const setSpeed = (value: number) => { lastFixedPos = nowScroll; - lastFixedTime = Date.now(); + lastFixedTime = -1; speed.value = value; }; const rescroll = () => { nowScroll = 0; - lastFixedTime = Date.now(); + lastFixedTime = -1; lastFixedPos = 0; }; @@ -302,8 +306,9 @@ const selectionProps = { export const Selection = defineComponent(props => { const minAlpha = computed(() => props.alphaRange?.[0] ?? 0.25); const maxAlpha = computed(() => props.alphaRange?.[1] ?? 0.55); - const alpha = transitioned( + const alpha = cycledTransition( minAlpha.value, + maxAlpha.value, 2000, cosh(2, CurveMode.EaseInOut) )!; @@ -336,15 +341,6 @@ export const Selection = defineComponent(props => { ctx.drawImage(image, 158, 66, 2, 28, width - 2, 2, 2, height - 4); }; - using.onExcitedFunc(() => { - if (alpha.value === maxAlpha.value) { - alpha.set(minAlpha.value); - } - if (alpha.value === minAlpha.value) { - alpha.set(maxAlpha.value); - } - }); - return () => isWinskin.value ? ( ( (props, { slots, expose }) => { + /** 根元素 */ + const root = useRendererRoot()!; + /** 滚动条的定位 */ const sp = ref([0, 0, 1, 1]); const listenedChild: Set = new Set(); const areaMap: Map = new Map(); - const content = ref(); - const scroll = ref(); + const content = shallowRef(); + const scroll = shallowRef(); const scrollAlpha = transitioned(0.5, 100, linear())!; @@ -132,10 +139,6 @@ export const Scroll = defineComponent( scroll.value?.update(); }); - /** 滚动内容的当前位置 */ - let contentPos = 0; - /** 滚动条的当前位置 */ - let scrollPos = 0; /** 滚动内容的目标位置 */ let contentTarget = 0; /** 滚动条的目标位置 */ @@ -145,25 +148,13 @@ export const Scroll = defineComponent( /** 滚动条的长度 */ let scrollLength = SCROLL_MIN_LENGTH; - const transition = new Transition(); - transition.value.scroll = 0; - transition.value.showScroll = 0; - transition.mode(cosh('sin', 'out')).absolute(); + /** 滚动条的当前位置 */ + const scrollPos = transitioned(0, 300, cosh(2, CurveMode.EaseOut))!; + /** 滚动内容的当前位置 */ + const contentPos = transitioned(0, 300, cosh(2, CurveMode.EaseOut))!; //#region 滚动操作 - transition.ticker.add(() => { - if (scrollPos !== scrollTarget) { - scrollPos = transition.value.scroll; - content.value?.update(); - } - if (contentPos !== contentTarget) { - contentPos = transition.value.showScroll; - checkAllItem(); - content.value?.update(); - } - }); - /** * 滚动到目标值 * @param time 动画时长 @@ -181,10 +172,14 @@ export const Scroll = defineComponent( (height.value - scrollLength) * (contentTarget / max); } if (isNaN(scrollTarget)) scrollTarget = 0; - transition.time(time).transition('scroll', scrollTarget); - transition.time(time).transition('showScroll', target); + scrollPos.set(scrollTarget, time); + contentPos.set(target, time); }; + watch(contentPos.ref, () => { + checkAllItem(); + }); + /** * 计算一个元素会在画面上显示的区域 */ @@ -200,13 +195,14 @@ export const Scroll = defineComponent( * 检查一个元素是否需要显示,不需要则隐藏 */ const checkItem = (item: IRenderItem) => { + if (item.isComment) return; const area = areaMap.get(item); if (!area) { item.show(); return; } const [min, max] = area; - if (contentPos > min - 10 && contentPos < max + 10) { + if (contentPos.value > min - 10 && contentPos.value < max + 10) { item.show(); } else { item.hide(); @@ -221,9 +217,10 @@ export const Scroll = defineComponent( }; /** - * 当一个元素的矩阵发生变换时执行,检查其显示区域 + * 更新容器中的渲染元素状态 + * @param item 渲染元素 */ - const onTransform = (item: IRenderItem) => { + const updateElementStatus = (item: IRenderItem) => { const rect = item.getBoundingRect(); const pad = props.padEnd ?? 0; if (item.parent === content.value) { @@ -239,7 +236,7 @@ export const Scroll = defineComponent( } } } else { - item.off('transform', onTransform); + item.removeHook(transformHook); listenedChild.delete(item); } getArea(item, rect); @@ -248,6 +245,18 @@ export const Scroll = defineComponent( content.value?.update(); }; + /** + * 当一个元素的矩阵发生变换时执行,检查其显示区域 + */ + const transformHook: IRenderItemBaseHooks = { + onTransform(item: IRenderItem) { + updateElementStatus(item); + }, + onResize(item: IRenderItem) { + updateElementStatus(item); + } + }; + /** * 更新滚动条位置 */ @@ -276,6 +285,10 @@ export const Scroll = defineComponent( }; let updating = false; + + /** + * 更新滚动条内容 + */ const updateScroll = () => { if (!content.value || updating) return; updating = true; @@ -283,7 +296,7 @@ export const Scroll = defineComponent( updating = false; }); let max = 0; - listenedChild.forEach(v => v.off('transform', onTransform)); + listenedChild.forEach(v => v.removeHook(transformHook)); listenedChild.clear(); areaMap.clear(); content.value.children.forEach(v => { @@ -300,7 +313,7 @@ export const Scroll = defineComponent( } getArea(v, rect); if (!listenedChild.has(v)) { - v.on('transform', onTransform); + v.addHook(transformHook); listenedChild.add(v); } checkItem(v); @@ -314,7 +327,7 @@ export const Scroll = defineComponent( onUpdated(updateScroll); onMounted(updateScroll); onUnmounted(() => { - listenedChild.forEach(v => v.off('transform', onTransform)); + listenedChild.forEach(v => v.removeHook(transformHook)); }); //#endregion @@ -328,7 +341,7 @@ export const Scroll = defineComponent( ctx.lineWidth = 3; ctx.strokeStyle = scrollColor.value; ctx.beginPath(); - const scroll = transition.value.scroll; + const scroll = scrollPos.value; if (direction.value === ScrollDirection.Horizontal) { ctx.moveTo(scroll + 5, 5); ctx.lineTo(scroll + scrollLength - 5, 5); @@ -347,9 +360,9 @@ export const Scroll = defineComponent( const ctx = canvas.ctx; ctx.save(); if (direction.value === ScrollDirection.Horizontal) { - ctx.translate(-contentPos, 0); + ctx.translate(-contentPos.value, 0); } else { - ctx.translate(0, -contentPos); + ctx.translate(0, -contentPos.value); } children.forEach(v => { if (v.hidden) return; @@ -373,9 +386,9 @@ export const Scroll = defineComponent( ) => { if (progress === EventProgress.Capture) { if (direction.value === ScrollDirection.Horizontal) { - event.offsetX += contentPos; + event.offsetX += contentPos.value; } else { - event.offsetY += contentPos; + event.offsetY += contentPos.value; } } origin(type, progress, event); @@ -471,9 +484,9 @@ export const Scroll = defineComponent( const pos = getPos(ev, true); // 计算点击在了滚动条的哪个位置 const offsetPos = getPos(ev); - const sEnd = scrollPos + scrollLength; - if (offsetPos >= scrollPos && offsetPos <= sEnd) { - scrollDownPos = pos - scrollPos; + const sEnd = scrollPos.value + scrollLength; + if (offsetPos >= scrollPos.value && offsetPos <= sEnd) { + scrollDownPos = pos - scrollPos.value; scrollMutate = false; scrollPin = getScrollPin(ev); } else { @@ -509,7 +522,7 @@ export const Scroll = defineComponent( scrollAlpha.set(0.7); if (!scrollMutate) return; const pos = getPos(ev); - if (pos < scrollPos) { + if (pos < scrollPos.value) { scrollTo(contentTarget - 50, 300); } else { scrollTo(contentTarget + 50, 300); @@ -526,15 +539,24 @@ export const Scroll = defineComponent( //#endregion + const hook: IRenderItemBaseHooks = { + onMove(ev) { + move(ev); + moveScroll(ev); + } + }; + + watch(root, (value, old) => { + old?.removeHook(hook); + value?.addHook(hook); + }); + onMounted(() => { - scroll.value?.root?.on('move', move); - scroll.value?.root?.on('move', moveScroll); + checkAllItem(); }); onUnmounted(() => { - scroll.value?.root?.off('move', move); - scroll.value?.root?.off('move', moveScroll); - transition.ticker.destroy(); + root.value?.removeHook(hook); }); //#region expose 函数 @@ -552,14 +574,16 @@ export const Scroll = defineComponent( return () => { return ( - + {slots.default?.()} diff --git a/packages-user/client-base/src/components/slider.tsx b/packages-user/client-base/src/components/slider.tsx index 0f49383..c1cd528 100644 --- a/packages-user/client-base/src/components/slider.tsx +++ b/packages-user/client-base/src/components/slider.tsx @@ -1,7 +1,8 @@ +import { IHookController } from '@motajs/common'; import { CanvasStyle, Font, IActionEvent, IRenderItem } from '@motajs/render'; import { DefaultProps } from '@motajs/render-vue'; import { SetupComponentOptions } from '@motajs/system'; -import { isNil } from 'lodash-es'; +import { clamp, isNil } from 'lodash-es'; import { computed, defineComponent, @@ -85,10 +86,10 @@ export const Slider = defineComponent< /** 当前值 */ const value = ref(props.value ?? min.value); - const container = ref(); + const rect = ref(); const width = computed(() => props.loc?.[2] ?? props.width ?? 200); - const height = computed(() => props.loc?.[3] ?? props.width ?? 200); + const height = computed(() => props.loc?.[3] ?? props.height ?? 200); const cy = computed(() => height.value / 2); const sx = computed(() => props.padding ?? 4); @@ -104,11 +105,19 @@ export const Slider = defineComponent< () => props.value, newValue => { if (!isNil(newValue)) { - value.value = newValue; + value.value = clamp(newValue, min.value, max.value); } } ); + watch(min, newValue => { + value.value = clamp(value.value, newValue, max.value); + }); + + watch(max, newValue => { + value.value = clamp(value.value, min.value, newValue); + }); + /** 端点横坐标 */ const fx = computed(() => { const ratio = (value.value - min.value) / (max.value - min.value); @@ -119,16 +128,22 @@ export const Slider = defineComponent< /** 数值显示值 */ const valueStr = computed(() => { const v = Number(value.value.toFixed(8)); - if (v < 1000 && v > 0.01) return value.value.toString(); - else return v.toExponential(2); + const abs = Math.abs(v); + if ((abs < 1000 && abs > 0.01) || abs < 1e-8) { + return value.value.toString(); + } else { + return v.toExponential(2); + } }); let dragging = false; let startX = -1; + let startValue = 0; const down = (ev: IActionEvent) => { dragging = true; startX = ev.absoluteX; + startValue = value.value; }; const up = () => { @@ -139,7 +154,7 @@ export const Slider = defineComponent< const move = (ev: IActionEvent) => { if (!dragging || startX < 0) return; const dx = ev.absoluteX - startX; - const ratio = (value.value - min.value) / (max.value - min.value); + const ratio = (startValue - min.value) / (max.value - min.value); const now = ratio * (ex.value - sx.value); if (dx < -now) { value.value = min.value; @@ -152,27 +167,41 @@ export const Slider = defineComponent< const step = props.step ?? 1; const steps = Math.round((targetValue - min.value) / step); const aligned = steps * step + min.value; - value.value = aligned; + value.value = clamp(aligned, min.value, max.value); emit('update:value', aligned); } }; + let controller: IHookController | null = null; onMounted(() => { - if (!container.value) return; - const root = container.value.root; + if (!rect.value) return; + const root = rect.value.root; if (!root) return; - root.on('moveCapture', move); + controller = root.addHook({ + onMoveCapture(ev) { + move(ev); + }, + onUpCapture() { + up(); + } + }); }); onUnmounted(() => { - if (!container.value) return; - const root = container.value.root; + if (!rect.value) return; + const root = rect.value.root; if (!root) return; - root.off('moveCapture', move); + controller?.unload(); }); return () => ( - + { if (needUpdate || props.hidden) return; needUpdate = true; @@ -407,15 +409,15 @@ export const Textbox = defineComponent< }); const onSetText = () => { - nextTick(() => { - titleElement.value?.requestBeforeFrame(() => { - if (titleElement.value) { - const { width, height } = titleElement.value; - tw.value = width + data.titlePadding! * 2; - th.value = height + data.titlePadding! * 2; - } - }); - }); + // nextTick(() => { + // titleElement.value?.requestBeforeFrame(() => { + // if (titleElement.value) { + // const { width, height } = titleElement.value; + // tw.value = width + data.titlePadding! * 2; + // th.value = height + data.titlePadding! * 2; + // } + // }); + // }); }; //#region store diff --git a/packages-user/client-base/src/components/textboxTyper.ts b/packages-user/client-base/src/components/textboxTyper.ts index 9f60a71..5b94f38 100644 --- a/packages-user/client-base/src/components/textboxTyper.ts +++ b/packages-user/client-base/src/components/textboxTyper.ts @@ -3,8 +3,7 @@ import { Font, MotaOffscreenCanvas2D } from '@motajs/render'; import EventEmitter from 'eventemitter3'; import { isNil } from 'lodash-es'; import { RenderableData, AutotileRenderable, texture } from '../elements'; -// @ts-expect-error render/renderer 按 D-54 留在实现层,本文件已移入系统层,按 D-59 暂以标注记录,不反向引用、不解耦 -import { using } from '../renderer'; +import { IExcitable } from '@motajs/animate'; /** 文字的安全填充,会填充在文字的上侧和下侧,防止削顶和削底 */ const SAFE_PAD = 1; @@ -244,7 +243,10 @@ interface TextContentTyperEvent { type TyperFunction = (data: TyperRenderable[], typing: boolean) => void; -export class TextContentTyper extends EventEmitter { +export class TextContentTyper + extends EventEmitter + implements IExcitable +{ /** 文字配置信息 */ readonly config: Required; /** 文字解析器 */ @@ -309,8 +311,6 @@ export class TextContentTyper extends EventEmitter { }, this.config ); - - using.onExcitedFunc(() => this.tick()); } /** @@ -491,7 +491,7 @@ export class TextContentTyper extends EventEmitter { /** * 每帧执行的函数 */ - private tick() { + excited() { if (!this.typing) return; const now = Date.now(); const needType = Math.round( diff --git a/packages-user/client-base/src/components/tip.tsx b/packages-user/client-base/src/components/tip.tsx index 403f0ba..7bb0c17 100644 --- a/packages-user/client-base/src/components/tip.tsx +++ b/packages-user/client-base/src/components/tip.tsx @@ -1,13 +1,11 @@ import { ElementLocator, Font } from '@motajs/render'; import { logger } from '@motajs/common'; import { computed, defineComponent, onUnmounted, ref } from 'vue'; -// @ts-expect-error render/use.ts 按 D-54 留在实现层,本文件已移入系统层,按 D-68 暂以标注记录,不反向引用、不解耦 -import { transitioned } from '../use'; import { cosh } from '@motajs/animate'; import { debounce } from 'lodash-es'; import { texture } from '../elements'; import { SetupComponentOptions } from '@motajs/system'; -import { DefaultProps } from '@motajs/render-vue'; +import { DefaultProps, transitioned } from '@motajs/render-vue'; export interface TipProps extends DefaultProps { /** 显示的位置 */