Skip to content

Commit c80319a

Browse files
committed
fix the / position in self closing tags
1 parent 386910f commit c80319a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/components/right-sidebar/CodeSnippet.vue

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ export default {
8686
},
8787
// Creates <template> boilerplate
8888
writeTemplateTag(componentName, activeComponent) {
89-
// console.log(this.activeComponentObj)
9089
const htmlElementMap = {
9190
div: ["<div", "</div>"],
9291
button: ["<button", "</button>"],
@@ -167,14 +166,14 @@ export default {
167166
if (el.class !== "") {
168167
outputStr += " " + "class = " + `"${el.class}"`;
169168
}
169+
170+
if (el.binding !== "") {
171+
outputStr += ` v-model = "${el.binding}"`
172+
}
170173
// add an extra slash at the end for child Components and single tags
171174
if(childComponents.includes(el.text) || el.text === "img" || el.text === "input" || el.text === "link"){
172175
outputStr += "/"
173176
}
174-
175-
if (el.binding !== "") {
176-
outputStr += ` v-model = "${el.binding}"`
177-
}
178177
outputStr += ">";
179178
if (el.children.length) {
180179
outputStr += "\n";

0 commit comments

Comments
 (0)