Skip to content

Commit a222860

Browse files
committed
Merge branch 'jigar-pinia' into pinia
2 parents 2ab446b + 520cb3b commit a222860

File tree

3 files changed

+23
-26
lines changed

3 files changed

+23
-26
lines changed

src/components/nav-buttons/ExportMenu.vue

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -413,25 +413,22 @@ const writeTemplate = (componentName, children, routes) => {
413413
? componentName
414414
: componentMap.value[componentName].htmlAttributes.class;
415415
416+
const arrOfChildComp = componentMap.value[componentName].children;
417+
arrOfChildComp.forEach((childName) => {
418+
let childNameClass = componentMap.value[childName].htmlAttributes.class;
419+
let childNameClassFullStr =
420+
childNameClass === "" ? "" : ` class = '${childNameClass}'`;
421+
routeStr += ` <${childName}${childNameClassFullStr}></${childName}>`;
422+
});
416423
if (compClass !== "" && compID !== "") {
417424
return `<template>\n <div id = "${compID}" class = "${compClass}">\n${templateTagStr}${routeStr} \n\t</div>\n</template>`;
418425
} else if (compClass !== "" && compID === "") {
419426
return `<template>\n <div class = "${compClass}">\n${templateTagStr}${routeStr} \n\t</div>\n</template>`;
420427
} else if (compClass === "" && compID !== "") {
421428
return `<template>\n <div id = "${compID}">\n${templateTagStr}${routeStr} </div>\n</template>`;
422429
} else {
423-
const arrOfChildComp = componentMap.value[componentName].children;
424-
arrOfChildComp.forEach((childName) => {
425-
let childNameClass = componentMap.value[childName].htmlAttributes.class;
426-
let childNameClassFullStr =
427-
childNameClass === "" ? "" : ` class = '${childNameClass}'`;
428-
routeStr += ` <${childName}${childNameClassFullStr}></${childName}>\n`;
429-
});
430-
431430
return `<template>\n <div>\n${str}${templateTagStr}${routeStr} </div>\n</template>`;
432431
}
433-
} else {
434-
return `<template>\n\t${str}${templateTagStr}${routeStr}\t</div>\n</template>`;
435432
}
436433
};
437434

src/components/nav-buttons/SaveProject.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const store = useStore();
3232
3333
const projects = computed(() => store.projects);
3434
const activeTab = computed(() => store.activeTab);
35-
const stateComputed = computed(() => store.state);
35+
const stateComputed = computed(() => store);
3636
const routes = computed(() => store.routes);
3737
3838
const addProject = (payload) => store.addProject(payload);

src/components/right-sidebar/CodeSnippet.vue

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -88,35 +88,35 @@ const createCodeSnippet = (componentName, children) => {
8888
// Creates beginner boilerplate
8989
const createTemplate = (componentName) => {
9090
let templateTagStr = writeTemplateTag(componentName, activeComponent.value); // testing 2nd arg
91+
let routeStr = "";
92+
const arrOfChildComp = componentMap.value[componentName].children;
93+
arrOfChildComp.forEach((childName) => {
94+
let childNameClass = componentMap.value[childName].htmlAttributes.class;
95+
let childNameClassFullStr =
96+
childNameClass === "" ? "" : ` class = '${childNameClass}'`;
97+
routeStr += ` <${childName}${childNameClassFullStr}></${childName}>\n`;
98+
});
9199
if (activeComponentObj.value.htmlAttributes) {
92100
//if/else statement to determine if there are class and id attributes present in the html element
93101
if (
94102
activeComponentObj.value.htmlAttributes.class !== "" &&
95103
activeComponentObj.value.htmlAttributes.id !== ""
96104
) {
97-
return `<template>\n <div id = "${activeComponentObj.value.htmlAttributes.id}" class = "${activeComponentObj.value.htmlAttributes.class}">\n${templateTagStr} </div>\n</template>`;
105+
return `<template>\n <div id = "${activeComponentObj.value.htmlAttributes.id}" class = "${activeComponentObj.value.htmlAttributes.class}">\n${templateTagStr}${routeStr} </div>\n</template>`;
98106
} else if (
99107
activeComponentObj.value.htmlAttributes.class !== "" &&
100108
activeComponentObj.value.htmlAttributes.id === ""
101109
) {
102-
return `<template>\n <div class = "${activeComponentObj.value.htmlAttributes.class}">\n${templateTagStr} </div>\n</template>`;
110+
return `<template>\n <div class = "${activeComponentObj.value.htmlAttributes.class}">\n${templateTagStr}${routeStr} </div>\n</template>`;
103111
} else if (
104112
activeComponentObj.value.htmlAttributes.class === "" &&
105113
activeComponentObj.value.htmlAttributes.id !== ""
106114
)
107-
return `<template>\n <div id = "${activeComponentObj.value.htmlAttributes.id}">\n${templateTagStr} </div>\n</template>`;
115+
return `<template>\n <div id = "${activeComponentObj.value.htmlAttributes.id}">\n${templateTagStr}${routeStr} </div>\n</template>`;
108116
else {
109-
let routeStr = "";
110-
const arrOfChildComp = componentMap.value[componentName].children;
111-
arrOfChildComp.forEach((childName) => {
112-
let childNameClass = componentMap.value[childName].htmlAttributes.class;
113-
let childNameClassFullStr =
114-
childNameClass === "" ? "" : ` class = '${childNameClass}'`;
115-
routeStr += ` <${childName}${childNameClassFullStr}></${childName}>\n`;
116-
});
117117
return `<template>\n <div>\n${templateTagStr}${routeStr} </div>\n</template>`;
118118
}
119-
} else return `<template>\n <div>\n${templateTagStr} </div>\n</template>`;
119+
}
120120
};
121121
122122
// Creates <template> boilerplate
@@ -401,9 +401,9 @@ const createBoiler = (componentName, children) => {
401401
let styleString = "";
402402
403403
if (activeComponentObj.value.htmlAttributes.class !== "") {
404-
styleString += `.${activeComponentObj.value.htmlAttributes.class} { \n background-color: ${activeComponentObj.value.color};
405-
grid-area: ${activeComponentObj.value.htmlAttributes.gridArea[0]} / ${activeComponentObj.value.htmlAttributes.gridArea[1]} / ${activeComponentObj.value.htmlAttributes.gridArea[2]} / ${activeComponentObj.value.htmlAttributes.gridArea[3]};
406-
z-index: ${activeComponentObj.value.z};
404+
styleString += `.${activeComponentObj.value.htmlAttributes.class} { \n\tbackground-color: ${activeComponentObj.value.color};
405+
\tgrid-area: ${activeComponentObj.value.htmlAttributes.gridArea[0]} / ${activeComponentObj.value.htmlAttributes.gridArea[1]} / ${activeComponentObj.value.htmlAttributes.gridArea[2]} / ${activeComponentObj.value.htmlAttributes.gridArea[3]};
406+
\tz-index: ${activeComponentObj.value.z};
407407
} \n`;
408408
}
409409

0 commit comments

Comments
 (0)