11<template >
2- <div >
2+ <div class = " codesnippet-container " >
33 <!-- <input type="checkbox" v-model="lineNumbers"> Linenumbers -->
4- {{ `${activeComponent}.vue` }}
4+ <div class =" top-p" v-if =" activeComponent === ''" >Select a component</div >
5+ <div v-else >{{ `${activeComponent}.vue` }}</div >
56 <prism-editor
67 v-model =" code"
78 language =" js"
@@ -23,7 +24,7 @@ import 'vue-prism-editor/dist/VuePrismEditor.css'
2324export default {
2425 data () {
2526 return {
26- code: ` Select a component` ,
27+ code: ` Your component boilerplate will be displayed here. ` ,
2728 lineNumbers: true ,
2829 height: null
2930 }
@@ -44,12 +45,10 @@ export default {
4445 // calls createTemplate and createBoiler to generate snippet
4546 createCodeSnippet (componentName , children ) {
4647 let result = ` ${ this .createTemplate (componentName, children)}${ this .createBoiler (componentName, children)} `
47- // console.log(`createCodeSnippet result: ${result}`)
4848 return result
4949 },
5050 createTemplate (componentName , children ) {
5151 let output = ` `
52- // let htmlArr = this.componentMap[compName].htmlList;
5352 output += ` <div>\n `
5453 children .forEach (name => {
5554 output += ` <${ name} >\n </${ name} >\n `
@@ -105,8 +104,6 @@ export default {
105104
106105 this .getWindowHeight ()
107106 })
108- // set code to this new string literal mofo
109- // this.code = `${this.createCodeSnippet(this.activeComponent, this.componentMap[this.activeComponent].children)}`
110107 },
111108 // updates code snippet, but broken cause children undefined, shows `function () { [native code] }`
112109 updated () {
@@ -122,9 +119,13 @@ export default {
122119<style lang="stylus" scoped>
123120// resize handled by vue lifecycle methods
124121.code-editor {
125- font-size : 11px ;
122+ font-size : 12px ;
123+ }
124+ .codesnippet-container {
125+ margin-bottom : 1rem ;
126126}
127127:: -webkit-scrollbar {
128128 display : none ;
129129}
130+
130131 </style >
0 commit comments