mirror of
https://github.com/motajs/template.git
synced 2026-12-02 03:44:29 +08:00
fix: TextContent 打字机更新问题
This commit is contained in:
1 parent
f9109001fe
commit
9658946d24
1 file changed
+3
-1
@@ -124,6 +124,7 @@ export const TextContent = defineComponent<
|
||||
props.typer ?? new TextContentTyper({ materials: materials.value })
|
||||
);
|
||||
const renderable = shallowRef<TyperRenderable[]>([]);
|
||||
const binding = ref(0);
|
||||
let needUpdate = false;
|
||||
|
||||
const hook: ITextContentTyperHooks = {
|
||||
@@ -228,6 +229,7 @@ export const TextContent = defineComponent<
|
||||
|
||||
const renderFunc = (data: TyperRenderable[]) => {
|
||||
renderable.value = data;
|
||||
binding.value++;
|
||||
};
|
||||
|
||||
watch(
|
||||
@@ -252,7 +254,7 @@ export const TextContent = defineComponent<
|
||||
<custom
|
||||
loc={loc.value}
|
||||
render={renderContent}
|
||||
bindings={[renderable.value]}
|
||||
bindings={[renderable.value, binding.value]}
|
||||
></custom>
|
||||
);
|
||||
}, textContentOptions);
|
||||
|
||||
Reference in new issue
Block a user