Skip to content

Commit

Permalink
feat(vue): fix vue2 HippyText setText
Browse files Browse the repository at this point in the history
  • Loading branch information
zealotchen0 committed Mar 26, 2024
1 parent 2dc1628 commit da5b5dd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/hippy-vue-next/src/runtime/text/hippy-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,14 @@ export class HippyText extends HippyNode {
super(NodeType.TextNode, ssrNode);
this.text = text;
this.data = text;

// text nodes do not need to be inserted into Native
this.isNeedInsertToNative = false;
}

public setText(text: string): void {
this.text = text;
if (this.parentNode && this.nodeType === NodeType.ElementNode) {
if (this.parentNode && this.parentNode.nodeType === NodeType.ElementNode) {
(this.parentNode as HippyElement).setText(text);
}
}
Expand Down

0 comments on commit da5b5dd

Please sign in to comment.