1
1
<template >
2
2
<div >
3
3
<!-- <input type="checkbox" v-model="lineNumbers"> Linenumbers -->
4
- {{ `${activeComponent}.vue` }}
4
+ <p v-if =" activeComponent === ''" >Select a Component</p >
5
+ <p v-else >{{ `${activeComponent}.vue` }}</p >
5
6
<prism-editor
6
7
v-model =" code"
7
8
language =" js"
@@ -23,7 +24,7 @@ import 'vue-prism-editor/dist/VuePrismEditor.css'
23
24
export default {
24
25
data () {
25
26
return {
26
- code: ` Select a component` ,
27
+ code: ` Your component boilerplate will be displayed here ` ,
27
28
lineNumbers: true ,
28
29
height: null
29
30
}
@@ -44,12 +45,10 @@ export default {
44
45
// calls createTemplate and createBoiler to generate snippet
45
46
createCodeSnippet (componentName , children ) {
46
47
let result = ` ${ this .createTemplate (componentName, children)}${ this .createBoiler (componentName, children)} `
47
- // console.log(`createCodeSnippet result: ${result}`)
48
48
return result
49
49
},
50
50
createTemplate (componentName , children ) {
51
51
let output = ` `
52
- // let htmlArr = this.componentMap[compName].htmlList;
53
52
output += ` <div>\n `
54
53
children .forEach (name => {
55
54
output += ` <${ name} >\n </${ name} >\n `
@@ -105,8 +104,6 @@ export default {
105
104
106
105
this .getWindowHeight ()
107
106
})
108
- // set code to this new string literal mofo
109
- // this.code = `${this.createCodeSnippet(this.activeComponent, this.componentMap[this.activeComponent].children)}`
110
107
},
111
108
// updates code snippet, but broken cause children undefined, shows `function () { [native code] }`
112
109
updated () {
0 commit comments