@tarojs/runtime 3.6.25 → 3.6.26-alpha.1

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.
@@ -78,7 +78,7 @@ interface MiniTextData {
78
78
  }
79
79
  type MiniData = MiniElementData | MiniTextData;
80
80
  type HydratedData = () => MiniData | MiniData[];
81
- type UpdatePayloadValue = string | boolean | HydratedData;
81
+ type UpdatePayloadValue = string | boolean | HydratedData | null;
82
82
  type DataTree = Record<string, UpdatePayloadValue | ReturnType<HydratedData>>;
83
83
  interface UpdatePayload {
84
84
  path: string;
@@ -828,6 +828,8 @@ class TaroNode extends TaroEventTarget {
828
828
  }
829
829
  // Data Structure
830
830
  const index = this.findIndex(child);
831
+ const isLastChild = index === this.childNodes.length - 1;
832
+ const path = child._path;
831
833
  this.childNodes.splice(index, 1);
832
834
  child.parentNode = null;
833
835
  // Set eventSource
@@ -836,7 +838,15 @@ class TaroNode extends TaroEventTarget {
836
838
  }
837
839
  // Serialization
838
840
  if (this._root && doUpdate !== false) {
839
- this.updateChildNodes();
841
+ if (isLastChild) {
842
+ this.enqueueUpdate({
843
+ path,
844
+ value: null
845
+ });
846
+ }
847
+ else {
848
+ this.updateChildNodes();
849
+ }
840
850
  }
841
851
  return child;
842
852
  }