File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/components/nav-buttons Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -250,7 +250,8 @@ export default {
250
250
str += ` \t\t </div>\n\t\t <router-view class = "router-view"></router-view>\n ` ;
251
251
}
252
252
else {
253
- str += ` <div>\n ` ;
253
+ // Adds component name as class for all routes
254
+ str += ` <div class = '${ componentName} '>\n ` ;
254
255
}
255
256
256
257
// Add import component string to routes template
@@ -265,8 +266,9 @@ export default {
265
266
let templateTagStr = this .writeTemplateTag (componentName);
266
267
// adds class/id into code snippet with exporting
267
268
if (this .componentMap [componentName].htmlAttributes ) {
269
+
268
270
let compID = this .componentMap [componentName].htmlAttributes .id ;
269
- let compClass = this .componentMap [componentName].htmlAttributes .class ;
271
+ let compClass = ( this . routes . hasOwnProperty (componentName)) ? componentName : this .componentMap [componentName].htmlAttributes .class ;
270
272
271
273
if (compClass !== " " && compID !== " " ) {
272
274
return ` <template>\n <div id = "${ compID} " class = "${ compClass} ">\n ${ templateTagStr}${ routeStr} </div>\n </template>` ;
@@ -275,7 +277,7 @@ export default {
275
277
return ` <template>\n <div class = "${ compClass} ">\n ${ templateTagStr}${ routeStr} </div>\n </template>` ;
276
278
}
277
279
else if (compClass === " " && compID !== " " ) {
278
- return ` <template>\n <div id = "${ this . componentMap [componentName]. htmlAttributes . id } ">\n ${ templateTagStr}${ routeStr} </div>\n </template>` ;
280
+ return ` <template>\n <div id = "${ compID } ">\n ${ templateTagStr}${ routeStr} </div>\n </template>` ;
279
281
}
280
282
else {
281
283
return ` <template>\n <div>\n\t ${ str}${ templateTagStr}${ routeStr} </div>\n </template>` ;
You can’t perform that action at this time.
0 commit comments