npm install abstract-component-node
ComponentNode follows Vue's element creation field structure
The MetaNode does not follow any structure.
The structure of the data structure and its fields is your freedom
However, you should be aware that the children field is re created as a child of Node.
And of the JSON fields
__initialKeys
__location
__parent
_initialKeys
_location
_parent
These six are reserved, so avoid using them as JSON fields.
I think this may be useless to you.
// ComponentNode
import ComponentNode from 'abstract-component-node';
let node = ComponentNode.importFromJSON(JSON, NodeLocationString = '0', ParentNode = null)
// MetaNode
import {MetaNode} from 'abstract-component-node';
let node = MetaNode.importFromJSON(JSON, NodeLocationString = '0', ParentNode = null)
Deep copy
Deep copied
Run the function while climbing the genealogy.
Stop visiting and return that node if returned true.
Stop visiting if returned true.
include self to visit target.
Info : importFromJSON (deep copy) Info : exportToJSON (deep copy)
Deep Copy
Deep copied
Stop visiting and return that node if returned true.
Stop visiting if returned true.
include self to visit target.
Run the function while climbing the genealogy.
tag : String
children : [JSONObject...]
classes : { className... : true }
style : { styleName : ... }
attrs,
props,
domProps,
on,
nativeOn,
directives,
scopedSlots,
slot,
nodeValue,
key,
ref,
{
"tag" : "_system-grid_",
"classes" : {
"test":true
},
"props" : {
},
"children" : [
{
"tag" : "_system-row_",
"props" : {
},
"children" : [
{
"tag" : "_system-column_",
"props": {
"xs" : 6,
"sm" : 4
},
"classes" : {
},
"children" : [
]
},
{
"tag" : "_system-column_",
"props": {
"xs" : 6,
"sm" : 8
},
"children" : [
]
},
{
"tag" : "_system-layer_",
"props" : {
},
"children" : [
]
}
]
},
{
"tag" : "_system-row_",
"props" : {
},
"children" : [
{
"tag" : "_system-column_",
"props": {
"xs" : 12,
"sm" : 6
},
"classes" : {
},
"children" : [
]
},
{
"tag" : "_system-column_",
"props": {
"xs" : 12,
"sm" : 6
},
"children" : [
]
}
]
},
{
"tag" : "_system-row_",
"props" : {
},
"children" : [
]
},
{
"tag" : "div",
"props" : {
},
"children" : [
]
}
]
}
Jinwoong Han ( theskyend0@gmail.com )