Skip to content

Commit d43111c

Browse files
Merge pull request #10 from oslabs-beta/Johnny
Can now add attributes to parent
2 parents 8b10e41 + 7c84711 commit d43111c

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/components/composables/useCreateComponent.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export function useCreateComponent(importObj) {
4343
isActive: false,
4444
color: "#ffffff85",
4545
htmlAttributes:{
46-
class:"test",
46+
class:"",
4747
id:"",
4848
}
4949
};

src/components/right-sidebar/CodeSnippet.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,9 @@ export default {
8080
// Creates beginner boilerplate
8181
createTemplate(componentName) {
8282
let templateTagStr = this.writeTemplateTag(componentName);
83-
if(this.activeComponentObj.htmlAttributes.class !== "") return `<template>\n <div class = "${this.activeComponentObj.htmlAttributes.class}">\n${templateTagStr} </div>\n</template>`;
84-
else return `<template>\n <div>\n${templateTagStr} </div>\n</template>`;
83+
console.log(this.activeComponentObj)
84+
// if(this.activeComponentObj.htmlAttributes.class !== "") return `<template>\n <div class = "${this.activeComponentObj.htmlAttributes.class}">\n${templateTagStr} </div>\n</template>`;
85+
// else return `<template>\n <div>\n${templateTagStr} </div>\n</template>`;
8586
8687
},
8788
// Creates <template> boilerplate

src/store/mutations.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,7 @@ const mutations = {
489489
isActive,
490490
actions,
491491
props,
492+
htmlAttributes,
492493
} = payload;
493494
const s = payload.state;
494495
state.componentMap = {
@@ -507,6 +508,7 @@ const mutations = {
507508
actions,
508509
props,
509510
state: s,
511+
htmlAttributes,
510512
},
511513
};
512514
},

0 commit comments

Comments
 (0)