Skip to content

Commit b28c769

Browse files
committed
hardcoded A div
1 parent 7f3e3f1 commit b28c769

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

src/components/CodeSnippet.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ export default {
5959
let templateTagStr = this.writeTemplateTag(componentName);
6060
return `<template>\n ${output}${templateTagStr} </div>\n</template>`;
6161
},
62+
63+
// We need a helper function to recursively iterate through the given html element's children and their children's children.
64+
6265
writeTemplateTag(componentName) {
6366
// console.log('writeTemplateTag invoked!')
6467
// create reference object

src/store/state/index.js

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,28 @@ import icons from './icons'
22
import htmlElementMap from './htmlElementMap'
33
const cloneDeep = require('lodash.clonedeep')
44

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+
527
const newState = {
628
icons,
729
htmlElementMap,
@@ -15,13 +37,14 @@ const newState = {
1537
},
1638
HomeView: {
1739
componentName: 'HomeView',
18-
children: [],
40+
children: ['a'],
1941
htmlList: []
20-
}
42+
},
2143
// NewView: {}
44+
a: hardA
2245
},
2346
routes: {
24-
HomeView: []
47+
HomeView: [hardA]
2548
// NewView: []
2649
},
2750
userActions: [],

0 commit comments

Comments
 (0)