Skip to content

Commit 0e673d1

Browse files
committed
implement hasAttribute for SSR
1 parent 9be3c13 commit 0e673d1

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

docs/components/PlotRender.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,25 @@ class Element {
4040
this.attributes[name] = String(value);
4141
}
4242
setAttributeNS(namespace, name, value) {
43-
this.attributes[name] = String(value);
43+
this.setAttribute(name, value);
44+
}
45+
getAttribute(name) {
46+
return this.attributes[name];
47+
}
48+
getAttributeNS(name) {
49+
return this.getAttribute(name);
50+
}
51+
hasAttribute(name) {
52+
return name in this.attributes;
53+
}
54+
hasAttributeNS(name) {
55+
return this.hasAttribute(name);
4456
}
4557
removeAttribute(name) {
4658
delete this.attributes[name];
4759
}
4860
removeAttributeNS(namespace, name) {
49-
delete this.attributes[name];
61+
this.removeAttribute(name);
5062
}
5163
appendChild(child) {
5264
this.children.push(child);

0 commit comments

Comments
 (0)