File tree Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Expand file tree Collapse file tree 2 files changed +29
-3
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,9 @@ export default {
59
59
let templateTagStr = this .writeTemplateTag (componentName);
60
60
return ` <template>\n ${ output}${ templateTagStr} </div>\n </template>` ;
61
61
},
62
+
63
+ // We need a helper function to recursively iterate through the given html element's children and their children's children.
64
+
62
65
writeTemplateTag (componentName ) {
63
66
// console.log('writeTemplateTag invoked!')
64
67
// create reference object
Original file line number Diff line number Diff line change @@ -2,6 +2,28 @@ import icons from './icons'
2
2
import htmlElementMap from './htmlElementMap'
3
3
const cloneDeep = require ( 'lodash.clonedeep' )
4
4
5
+ let hardA = {
6
+ componentName : "a" ,
7
+ x : 0 ,
8
+ y : 20 ,
9
+ z : 0 ,
10
+ w : 200 ,
11
+ h : 200 ,
12
+ htmlList : [ {
13
+ children :[ {
14
+ children :[ ] ,
15
+ text :'form'
16
+ } ] ,
17
+ text : "div"
18
+ } ] ,
19
+ children : [ ] ,
20
+ parent : { } ,
21
+ isActive : false
22
+ }
23
+
24
+
25
+
26
+
5
27
const newState = {
6
28
icons,
7
29
htmlElementMap,
@@ -15,13 +37,14 @@ const newState = {
15
37
} ,
16
38
HomeView : {
17
39
componentName : 'HomeView' ,
18
- children : [ ] ,
40
+ children : [ 'a' ] ,
19
41
htmlList : [ ]
20
- }
42
+ } ,
21
43
// NewView: {}
44
+ a : hardA
22
45
} ,
23
46
routes : {
24
- HomeView : [ ]
47
+ HomeView : [ hardA ]
25
48
// NewView: []
26
49
} ,
27
50
userActions : [ ] ,
You can’t perform that action at this time.
0 commit comments