master
yutent 2024-03-14 18:42:13 +08:00
parent 95c922f7ea
commit 4814b9c398
1 changed files with 8 additions and 10 deletions

View File

@ -1275,16 +1275,14 @@ export class SnapElement {
return Array.from(this.node.childNodes).map(n => new Snap(n))
}
/*\
**
* Returns object representation of the given element and all its children.
= (object) in format
o {
o type (string) this.type,
o attr (object) attributes map,
o childNodes (array) optional array of children in the same format
o }
\*/
/**
* Returns object representation of the given element and all its children.
{
type (string) this.type,
attr (object) attributes map,
childNodes (array) optional array of children in the same format
}
*/
toJSON() {
let out = []
jsonFiller([this], out)