fix: TextContent 运行报错

This commit is contained in:
AncTe committed 2026-11-25 20:31:46 +08:00
1 parent 82ac159eaa
commit b676cb185b
1 file changed
+10 -10
@@ -131,16 +131,6 @@ export const TextContent = defineComponent<
}
};
watch(
root,
(value, old) => {
old?.excitation.remove(typer.value);
value?.excitation.add(typer.value);
retype();
},
{ immediate: true }
);
/** 从头开始重新打字 */
const retype = () => {
if (needUpdate || props.hidden) return;
@@ -184,6 +174,16 @@ export const TextContent = defineComponent<
watch(width, updateLoc);
watch(
root,
(value, old) => {
old?.excitation.remove(typer.value);
value?.excitation.add(typer.value);
retype();
},
{ immediate: true }
);
expose<TextContentExpose>({ retype, showAll, getHeight });
const renderContent = (canvas: MotaOffscreenCanvas2D) => {