Skip to content

Commit 4324fa0

Browse files
committed
implement cloneNode
1 parent 5478728 commit 4324fa0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: docs/components/PlotRender.js

+6
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ class Element {
9090
child.parentNode = this;
9191
return child;
9292
}
93+
cloneNode(deep) {
94+
const clone = new Element(this.ownerDocument, this.tagName);
95+
clone.attributes = {...this.attributes};
96+
if (deep) clone.children = this.children.map((child) => child.cloneNode(deep));
97+
return clone;
98+
}
9399
querySelector() {
94100
return null;
95101
}

0 commit comments

Comments
 (0)