mirror of
https://github.com/motajs/template.git
synced 2026-12-01 03:04:30 +08:00
fix: TextContent 运行报错
This commit is contained in:
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) => {
|
||||
|
||||
Reference in new issue
Block a user