@tarojs/plugin-platform-harmony-ets 4.0.0-beta.4 → 4.0.0-beta.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/dist/apis/base/system.ts +53 -20
  2. package/dist/apis/canvas/index.ts +10 -1
  3. package/dist/apis/framework/index.ts +1 -5
  4. package/dist/apis/index.ts +32 -17
  5. package/dist/apis/network/request.ts +5 -5
  6. package/dist/apis/route/index.ts +15 -0
  7. package/dist/apis/storage/index.ts +205 -63
  8. package/dist/apis/ui/animation/animation.ts +2 -1
  9. package/dist/apis/utils/index.ts +1 -1
  10. package/dist/apis/wxml/IntersectionObserver.ts +18 -10
  11. package/dist/apis/wxml/index.ts +2 -0
  12. package/dist/apis/wxml/selectorQuery.ts +18 -9
  13. package/dist/components-harmony-ets/button.ets +48 -34
  14. package/dist/components-harmony-ets/canvas.ets +51 -0
  15. package/dist/components-harmony-ets/checkbox.ets +69 -61
  16. package/dist/components-harmony-ets/form.ets +51 -29
  17. package/dist/components-harmony-ets/icon.ets +34 -19
  18. package/dist/components-harmony-ets/image.ets +27 -14
  19. package/dist/components-harmony-ets/index.ets +76 -0
  20. package/dist/components-harmony-ets/innerHtml.ets +11 -6
  21. package/dist/components-harmony-ets/input.ets +41 -40
  22. package/dist/components-harmony-ets/label.ets +71 -42
  23. package/dist/components-harmony-ets/movableArea.ets +126 -0
  24. package/dist/components-harmony-ets/movableView.ets +73 -0
  25. package/dist/components-harmony-ets/picker.ets +42 -38
  26. package/dist/components-harmony-ets/progress.ets +52 -0
  27. package/dist/components-harmony-ets/pseudo.ets +80 -0
  28. package/dist/components-harmony-ets/radio.ets +71 -64
  29. package/dist/components-harmony-ets/richText.ets +14 -30
  30. package/dist/components-harmony-ets/scrollView.ets +57 -30
  31. package/dist/components-harmony-ets/slider.ets +15 -14
  32. package/dist/components-harmony-ets/style.ets +385 -130
  33. package/dist/components-harmony-ets/swiper.ets +32 -20
  34. package/dist/components-harmony-ets/switch.ets +30 -28
  35. package/dist/components-harmony-ets/text.ets +121 -51
  36. package/dist/components-harmony-ets/textArea.ets +35 -34
  37. package/dist/components-harmony-ets/utils/AttributeManager.ets +1 -1
  38. package/dist/components-harmony-ets/utils/DynamicCenter.ts +1 -1
  39. package/dist/components-harmony-ets/utils/flexManager.ets +43 -19
  40. package/dist/components-harmony-ets/utils/helper.ets +4 -5
  41. package/dist/components-harmony-ets/utils/htmlParser/HarmonyHTMLParser.ts +1 -2
  42. package/dist/components-harmony-ets/utils/htmlParser/index.ts +1 -1
  43. package/dist/components-harmony-ets/utils/index.ts +50 -51
  44. package/dist/components-harmony-ets/utils/styles.ets +164 -92
  45. package/dist/components-harmony-ets/video.ets +34 -20
  46. package/dist/components-harmony-ets/view.ets +62 -29
  47. package/dist/components-harmony-ets/webView.ets +40 -34
  48. package/dist/index.d.ts +152 -0
  49. package/dist/index.js +74 -37
  50. package/dist/index.js.map +1 -1
  51. package/dist/runtime-ets/bom/document.ts +1 -1
  52. package/dist/runtime-ets/bom/window.ts +7 -0
  53. package/dist/runtime-ets/current.ts +3 -0
  54. package/dist/runtime-ets/dom/bind.ts +20 -6
  55. package/dist/runtime-ets/dom/cssNesting.ts +393 -0
  56. package/dist/runtime-ets/dom/cssStyleDeclaration.ts +12 -40
  57. package/dist/runtime-ets/dom/document.ts +23 -8
  58. package/dist/runtime-ets/dom/element/canvas.ts +136 -0
  59. package/dist/runtime-ets/dom/element/element.ts +218 -51
  60. package/dist/runtime-ets/dom/element/form.ts +15 -18
  61. package/dist/runtime-ets/dom/element/index.ts +18 -2
  62. package/dist/runtime-ets/dom/element/movableArea.ts +12 -0
  63. package/dist/runtime-ets/dom/element/movableView.ts +193 -0
  64. package/dist/runtime-ets/dom/element/normal.ts +13 -4
  65. package/dist/runtime-ets/dom/element/progress.ts +12 -0
  66. package/dist/runtime-ets/dom/element/scrollView.ts +1 -0
  67. package/dist/runtime-ets/dom/element/text.ts +1 -8
  68. package/dist/runtime-ets/dom/element/video.ts +5 -3
  69. package/dist/runtime-ets/dom/element/webView.ts +8 -0
  70. package/dist/runtime-ets/dom/event.ts +0 -1
  71. package/dist/runtime-ets/dom/eventTarget.ts +0 -3
  72. package/dist/runtime-ets/dom/node.ts +45 -27
  73. package/dist/runtime-ets/dom/stylesheet/covertWeb2Hm.ts +330 -230
  74. package/dist/runtime-ets/dom/stylesheet/index.ts +28 -308
  75. package/dist/runtime-ets/dom/stylesheet/type.ts +28 -9
  76. package/dist/runtime-ets/dom/stylesheet/util.ts +33 -27
  77. package/dist/runtime-ets/index.ts +2 -2
  78. package/dist/runtime-ets/interface/event.ts +1 -1
  79. package/dist/runtime-ets/utils/index.ts +43 -10
  80. package/dist/runtime-ets/utils/info.ts +1 -1
  81. package/dist/runtime-framework/react/app.ts +7 -2
  82. package/dist/runtime-framework/react/index.ts +0 -2
  83. package/dist/runtime-framework/react/native-page.ts +22 -12
  84. package/dist/runtime-framework/react/page.ts +3 -8
  85. package/dist/runtime-framework/solid/app.ts +25 -45
  86. package/dist/runtime-framework/solid/connect.ts +21 -3
  87. package/dist/runtime-framework/solid/hooks.ts +16 -11
  88. package/dist/runtime-framework/solid/index.ts +6 -2
  89. package/dist/runtime-framework/solid/page.ts +84 -30
  90. package/dist/runtime-framework/solid/reconciler/props.ts +65 -20
  91. package/dist/runtime-framework/solid/reconciler/render.ts +16 -6
  92. package/dist/runtime-framework/solid/reconciler/use.ts +0 -1
  93. package/dist/runtime-framework/solid/utils/index.ts +0 -2
  94. package/dist/runtime-utils.d.ts +827 -0
  95. package/dist/runtime-utils.js +293 -119
  96. package/dist/runtime-utils.js.map +1 -1
  97. package/dist/runtime.d.ts +1 -0
  98. package/dist/runtime.js +293 -119
  99. package/dist/runtime.js.map +1 -1
  100. package/index.js +3 -1
  101. package/package.json +13 -13
  102. package/types/index.d.ts +4 -0
  103. package/dist/runtime-ets/utils/bind.ts +0 -24
  104. /package/dist/components-harmony-ets/{index.ts → tag.ts} +0 -0
  105. /package/dist/runtime-framework/solid/{contant.ts → constant.ts} +0 -0
@@ -0,0 +1,193 @@
1
+ import { TaroElement } from './element'
2
+
3
+ import type { MovableViewProps } from '@tarojs/components/types'
4
+
5
+ type Tsize = {
6
+ w: number
7
+ h: number
8
+ }
9
+ type Tpoint = {
10
+ x: number
11
+ y: number
12
+ }
13
+
14
+ function calcPosition(postion: number, start: number, end: number) {
15
+ if (postion <= end && postion >= start) {
16
+ return postion
17
+ } else if (postion < start) {
18
+ return start
19
+ } else {
20
+ return end
21
+ }
22
+ }
23
+
24
+ @Observed
25
+ export class TaroMovableViewElement extends TaroElement<MovableViewProps & { animation: undefined }> {
26
+ _scaleValue = 1
27
+ _scalevalueTemp = 1
28
+
29
+ // 父级区别的大小
30
+ _area?: Tsize
31
+ // 自己元素的大小
32
+ _selfSize?: Tsize
33
+
34
+ // 元素的位置
35
+ _position: Tpoint = {
36
+ x: 0,
37
+ y: 0,
38
+ }
39
+
40
+ _positionTemp: Tpoint = {
41
+ x: 0,
42
+ y: 0,
43
+ }
44
+
45
+ constructor() {
46
+ super('MovableView')
47
+ }
48
+
49
+ get _outOfBounds() {
50
+ if (this.getAttribute('outOfBounds')) {
51
+ return this.selfSize ? this.selfSize.w / 3 : 0
52
+ }
53
+ return 0
54
+ }
55
+
56
+ set area(val: Tsize) {
57
+ this._area = val
58
+ }
59
+
60
+ get area(): Tsize | undefined {
61
+ return this._area
62
+ }
63
+
64
+ startScale() {
65
+ this._scalevalueTemp = this._scaleValue
66
+ }
67
+
68
+ doScale(val: number) {
69
+ const scale = this.getAttribute('scale')
70
+
71
+ // 禁止缩放的时候不生效
72
+ if (scale) {
73
+ this.scaleValue = val * this._scalevalueTemp
74
+ }
75
+ }
76
+
77
+ set scaleValue(val: number) {
78
+ if (this.checkScaleValueInBounds(val)) {
79
+ this._scaleValue = val
80
+
81
+ this.checkPositionBoundary(this.position, val)
82
+
83
+ const bindscale = this.getAttribute('bindscale')
84
+ typeof bindscale === 'function' && bindscale({ ...this.position, scale: this.scaleValue })
85
+ }
86
+ }
87
+
88
+ get scaleValue() {
89
+ return this._scaleValue
90
+ }
91
+
92
+ startMove() {
93
+ this._positionTemp = this._position
94
+ }
95
+
96
+ doMove(val: Tpoint) {
97
+ if (!this.area || !this.selfSize) return
98
+ if (this.getAttribute('disabled')) return
99
+ const direction = this.getAttribute('direction')
100
+
101
+ // 容器的宽高终点
102
+ const areaWidthEnd = this.area.w - this.selfSize.w * this.scaleValue
103
+ const areaHeightEnd = this.area.h - this.selfSize.h * this.scaleValue
104
+
105
+ const incrementWidth = (this.scaleValue - 1) * this.selfSize.w
106
+ const incrementHeight = (this.scaleValue - 1) * this.selfSize.h
107
+
108
+ let x = this._positionTemp.x
109
+ let y = this._positionTemp.y
110
+ if (['all', 'horizontal'].includes(direction)) {
111
+ const nextX = this._positionTemp.x + val.x * this.scaleValue
112
+ x = calcPosition(
113
+ nextX,
114
+ incrementWidth * 0.5 - this._outOfBounds,
115
+ areaWidthEnd + incrementWidth * 0.5 + this._outOfBounds
116
+ )
117
+ }
118
+
119
+ if (['all', 'vertical'].includes(direction)) {
120
+ const nextY = this._positionTemp.y + val.y * this.scaleValue
121
+ y = calcPosition(
122
+ nextY,
123
+ incrementHeight * 0.5 - this._outOfBounds,
124
+ areaHeightEnd + incrementHeight * 0.5 + this._outOfBounds
125
+ )
126
+ }
127
+ const bindchange = this.getAttribute('bindchange')
128
+ if (typeof bindchange === 'function') {
129
+ bindchange({ x, y, source: 'touch' })
130
+ }
131
+ this.position = {
132
+ x: x,
133
+ y: y,
134
+ }
135
+ }
136
+
137
+ get position() {
138
+ return this._position
139
+ }
140
+
141
+ set position(val: Tpoint) {
142
+ this._position = val
143
+ }
144
+
145
+ set selfSize(val: Tsize) {
146
+ this._selfSize = val
147
+ }
148
+
149
+ get selfSize(): Tsize | undefined {
150
+ return this._selfSize
151
+ }
152
+
153
+ checkPositionBoundary(position: Tpoint, scale: number) {
154
+ if (!this.area || !this.selfSize) {
155
+ return { x: 0, y: 0 }
156
+ }
157
+
158
+ const areaWidthEnd = this.area.w - this.selfSize.w * scale
159
+ const areaHeightEnd = this.area.h - this.selfSize.h * scale
160
+
161
+ const incrementWidth = (scale - 1) * this.selfSize.w
162
+ const incrementHeight = (scale - 1) * this.selfSize.h
163
+
164
+ this.position = {
165
+ x: calcPosition(position.x, incrementWidth * 0.5, areaWidthEnd + incrementWidth * 0.5),
166
+ y: calcPosition(position.y, incrementHeight * 0.5, areaHeightEnd + incrementHeight * 0.5),
167
+ }
168
+ }
169
+
170
+ checkScaleValueInBounds(currentScale: number) {
171
+ const scaleMin = this.getAttribute('scaleMin')
172
+ const scaleMax = this.getAttribute('scaleMax')
173
+
174
+ if (scaleMin && Number(scaleMin) >= 0.1 && currentScale < Number(scaleMin)) {
175
+ return false
176
+ } else if (scaleMax && Number(scaleMax) >= 0.1 && currentScale > Number(scaleMax)) {
177
+ return false
178
+ }
179
+
180
+ return true
181
+ }
182
+
183
+ public setAttribute(name: string, value: any): void {
184
+ if (name === 'x') {
185
+ this.checkPositionBoundary({ x: value, y: this.position.y }, this.scaleValue)
186
+ }
187
+ if (name === 'y') {
188
+ this.checkPositionBoundary({ x: this.position.x, y: value }, this.scaleValue)
189
+ }
190
+
191
+ super.setAttribute(name, value)
192
+ }
193
+ }
@@ -12,43 +12,51 @@ import type {
12
12
  ViewProps
13
13
  } from '@tarojs/components/types'
14
14
 
15
+ @Observed
16
+ class TaroOtherElement extends TaroElement<ViewProps> {}
17
+
18
+ @Observed
15
19
  class TaroViewElement extends TaroElement<ViewProps> {
16
20
  constructor() {
17
21
  super('View')
18
22
  }
19
23
  }
20
24
 
25
+ @Observed
21
26
  class TaroImageElement extends TaroElement<ImageProps> {
22
27
  constructor() {
23
28
  super('Image')
24
29
  }
25
30
  }
26
31
 
32
+ @Observed
27
33
  class TaroButtonElement extends TaroElement<ButtonProps> {
28
34
  constructor() {
29
35
  super('Button')
30
36
  }
31
37
  }
32
38
 
33
-
39
+ @Observed
34
40
  class TaroIconElement extends TaroElement<IconProps>{
35
41
  constructor() {
36
42
  super('Icon')
37
43
  }
38
44
  }
39
-
45
+ @Observed
40
46
  class TaroLabelElement extends TaroElement<LabelProps>{
41
47
  constructor() {
42
48
  super('Label')
43
49
  }
44
50
  }
45
51
 
52
+ @Observed
46
53
  class TaroRichTextElement extends TaroElement<RichTextProps>{
47
54
  constructor() {
48
55
  super('RichText')
49
56
  }
50
57
  }
51
58
 
59
+ @Observed
52
60
  class TaroSwiperElement extends TaroElement<SwiperProps>{
53
61
  controller: SwiperController = new SwiperController()
54
62
 
@@ -57,20 +65,21 @@ class TaroSwiperElement extends TaroElement<SwiperProps>{
57
65
  }
58
66
  }
59
67
 
68
+ @Observed
60
69
  class TaroSwiperItemElement extends TaroElement<SwiperItemProps>{
61
70
  constructor() {
62
71
  super('SwiperItem')
63
72
  }
64
73
  }
65
74
 
66
-
67
75
  export {
68
76
  TaroButtonElement,
69
77
  TaroIconElement,
70
78
  TaroImageElement,
71
79
  TaroLabelElement,
80
+ TaroOtherElement,
72
81
  TaroRichTextElement,
73
82
  TaroSwiperElement,
74
83
  TaroSwiperItemElement,
75
- TaroViewElement,
84
+ TaroViewElement
76
85
  }
@@ -0,0 +1,12 @@
1
+
2
+ import { TaroElement } from './element'
3
+
4
+ import type { ProgressProps } from '@tarojs/components/types'
5
+
6
+ @Observed
7
+ export class TaroProgressElement extends TaroElement<ProgressProps> {
8
+
9
+ constructor() {
10
+ super('Progress')
11
+ }
12
+ }
@@ -3,6 +3,7 @@ import { TaroElement } from './element'
3
3
 
4
4
  import type { ScrollViewProps } from '@tarojs/components/types'
5
5
 
6
+ @Observed
6
7
  export class TaroScrollViewElement extends TaroElement<ScrollViewProps> {
7
8
  scroller: Scroller = new Scroller()
8
9
 
@@ -1,17 +1,10 @@
1
- import { TaroNode } from '../node'
2
1
  import { TaroElement } from './element'
3
2
 
4
3
  import type { TextProps } from '@tarojs/components/types'
5
4
 
5
+ @Observed
6
6
  export class TaroTextElement extends TaroElement<TextProps> {
7
7
  constructor() {
8
8
  super('Text')
9
9
  }
10
-
11
- public appendChild (child: TaroNode): TaroNode {
12
- super.appendChild(child)
13
-
14
- this.updateComponent()
15
- return child
16
- }
17
10
  }
@@ -2,13 +2,15 @@ import { TaroElement } from './element'
2
2
 
3
3
  import type { VideoProps } from '@tarojs/components/types'
4
4
 
5
+ @Observed
5
6
  export class TaroVideoElement extends TaroElement<VideoProps> {
6
- _currentTime = 0
7
7
 
8
8
  controller: VideoController = new VideoController()
9
9
 
10
10
  constructor() {
11
11
  super('Video')
12
+
13
+ this._nodeInfo._currentTime = 0
12
14
  }
13
15
 
14
16
  async play() {
@@ -39,11 +41,11 @@ export class TaroVideoElement extends TaroElement<VideoProps> {
39
41
  }
40
42
 
41
43
  get currentTime() {
42
- return this._currentTime
44
+ return this._nodeInfo._currentTime
43
45
  }
44
46
 
45
47
  set currentTime(val: number) {
46
- this._currentTime = val
48
+ this._nodeInfo._currentTime = val
47
49
  this.controller.setCurrentTime(val)
48
50
  }
49
51
  }
@@ -5,6 +5,14 @@ import { TaroElement } from './element'
5
5
 
6
6
  import type { WebViewProps } from '@tarojs/components/types'
7
7
 
8
+ @Observed
9
+ export class TaroInnerHtmlElement extends TaroElement {
10
+ constructor() {
11
+ super('InnerHtml')
12
+ }
13
+ }
14
+
15
+ @Observed
8
16
  export class TaroWebViewElement extends TaroElement<WebViewProps>{
9
17
  ports: web_webview.WebMessagePort[] = []
10
18
 
@@ -55,7 +55,6 @@ export class TaroEvent<T = any> {
55
55
  }
56
56
  }
57
57
 
58
-
59
58
  export function createEvent (event: TaroEvent | string, type?: string, node?: TaroElement) {
60
59
  if (typeof event === 'string') {
61
60
  // For Vue3 using document.createEvent
@@ -68,12 +68,10 @@ class TaroEventTarget extends Events {
68
68
  }
69
69
  }
70
70
 
71
-
72
71
  if (event._stop) {
73
72
  this._stopPropagation(event)
74
73
  }
75
74
 
76
-
77
75
  return listeners != null
78
76
  }
79
77
 
@@ -95,5 +93,4 @@ class TaroEventTarget extends Events {
95
93
  }
96
94
  }
97
95
 
98
-
99
96
  export { TaroEventTarget }
@@ -59,34 +59,37 @@ export class TaroNode extends TaroDataSourceElement {
59
59
  return this.childNodes[index] as TaroElement
60
60
  }
61
61
 
62
- public findIndex (refChild: TaroNode): number {
63
- return this.childNodes.findIndex(node => node._nid === refChild._nid)
62
+ public findIndex (refChild?: TaroNode): number {
63
+ return this.childNodes.findIndex(node => node._nid === refChild?._nid)
64
64
  }
65
65
 
66
- // 更新对应的 ArkUI 组件
67
- public updateComponent () {
68
- if (!this._isCompileMode && (!this.parentNode || !this.parentNode.listeners?.length)) return
66
+ public updateTextNode () {
67
+ // @ts-ignore
68
+ if (this.childNodes.length <= 0 || this.tagName !== 'VIEW') return
69
69
 
70
- const idx = this.parentNode.findIndex(this)
70
+ // TextNode 不具备 props 更新能力,需要由父节点来进行触发
71
+ this.childNodes.forEach(item => {
72
+ if (item.nodeType !== NodeType.TEXT_NODE) return
71
73
 
72
- if (this._isCompileMode) {
73
- // 半编译模式下走 @State 的更新模式
74
- if (this._isDynamicNode) {
75
- this._updateTrigger++
76
- } else {
77
- this.parentNode.updateComponent()
78
- }
74
+ item._updateTrigger++
75
+ })
76
+ }
77
+
78
+ // 更新对应的 ArkUI 组件
79
+ public updateComponent () {
80
+ // 非半编译模式或者半编译模式下拥有自主更新权力的节点走 @State 的更新模式
81
+ if (this._isDynamicNode || !this._isCompileMode) {
82
+ this._updateTrigger++
79
83
  } else {
80
- // 非半编译模式下走 LazyForEach 的更新模式
81
- if (idx >= 0) {
82
- this._updateTrigger++
83
- this.parentNode.notifyDataChange(idx)
84
- } else {
85
- this.parentNode.notifyDataReload()
86
- }
84
+ this.parentNode?.updateComponent()
87
85
  }
88
86
  }
89
87
 
88
+ // 提供唯一标识,方便与小程序一致,能根据uid获取到对应的节点
89
+ public get uid (): string {
90
+ return this._nid
91
+ }
92
+
90
93
  public get firstChild (): TaroNode | null{
91
94
  return this.childNodes[0] || null
92
95
  }
@@ -128,11 +131,12 @@ export class TaroNode extends TaroDataSourceElement {
128
131
  public set textContent (value: string) {
129
132
  if (this.nodeType === NodeType.TEXT_NODE) {
130
133
  this._textContent = value
131
- this.parentNode?.updateComponent()
132
134
  } else if (this.nodeType === NodeType.ELEMENT_NODE) {
133
135
  const node = new TaroTextNode(value)
134
136
  node._doc = this.ownerDocument
135
- this.childNodes = [node]
137
+ node.parentNode = this
138
+ this.childNodes.length = 0
139
+ this.childNodes.push(node)
136
140
  }
137
141
  }
138
142
 
@@ -150,7 +154,6 @@ export class TaroNode extends TaroDataSourceElement {
150
154
  public set nodeValue (value: string | null) {
151
155
  if (this.nodeType === NodeType.TEXT_NODE && value) {
152
156
  this.textContent = value
153
- this.parentNode?.updateComponent()
154
157
  }
155
158
  }
156
159
 
@@ -163,28 +166,37 @@ export class TaroNode extends TaroDataSourceElement {
163
166
  }
164
167
 
165
168
  // TODO cloneNode()、contains()
166
-
167
- public appendChild (child: TaroNode): TaroNode {
169
+ public connectParentNode (child: TaroNode) {
168
170
  child.parentNode?.removeChild(child)
169
171
  child.parentNode = this
172
+ }
170
173
 
174
+ public appendChild (child: TaroNode): TaroNode {
175
+ this.connectParentNode(child)
171
176
  this.childNodes.push(child)
172
177
  this.notifyDataAdd(this.childNodes.length - 1)
173
178
 
179
+ // @ts-ignore
180
+ child.toggleLayer?.(true)
181
+
174
182
  checkIsCompileModeAndInstallAfterDOMAction(child, this)
175
183
  return child
176
184
  }
177
185
 
178
- public insertBefore (newNode: TaroNode, referenceNode: TaroNode | null): TaroNode {
186
+ public insertBefore (newNode: TaroNode, referenceNode?: TaroNode): TaroNode {
179
187
  newNode.parentNode?.removeChild(newNode)
180
188
 
181
- if (referenceNode === null) {
189
+ if (!referenceNode) {
182
190
  this.appendChild(newNode)
183
191
  } else {
184
192
  const idxOfRef = this.findIndex(referenceNode)
185
193
  this.childNodes.splice(idxOfRef, 0, newNode)
194
+ this.connectParentNode(newNode)
186
195
  // TODO: 优化
187
196
  this.notifyDataReload()
197
+
198
+ // @ts-ignore
199
+ newNode.toggleLayer?.(true)
188
200
  }
189
201
 
190
202
  checkIsCompileModeAndInstallAfterDOMAction(newNode, this)
@@ -224,11 +236,17 @@ export class TaroNode extends TaroDataSourceElement {
224
236
  }
225
237
 
226
238
  public dispose () {
239
+ // 渲染,层级大于0的节点需要让其回到正常层级,然后删掉
240
+ // @ts-ignore
241
+ this.toggleLayer?.(false)
242
+
227
243
  this.parentNode = null
228
244
  this.childNodes = []
229
245
  }
246
+
230
247
  }
231
248
 
249
+ @Observed
232
250
  export class TaroTextNode extends TaroNode {
233
251
  constructor(value = '', nodeName = '#text', nodeType: NodeType = NodeType.TEXT_NODE) {
234
252
  super(nodeName, nodeType)