@@ -258,7 +258,9 @@ export default {
258
258
if (this .routes .hasOwnProperty (componentName)){
259
259
const arrOfChildComp = this .componentMap [componentName].children ;
260
260
arrOfChildComp .forEach (childName => {
261
- routeStr += ` <${ childName} ></${ childName} >\n `
261
+ let childNameClass = this .componentMap [childName].htmlAttributes .class ;
262
+ let childNameClassFullStr = (childNameClass === " " ) ? " " : ` class = '${ childNameClass} '` ;
263
+ routeStr += ` <${ childName}${ childNameClassFullStr} ></${ childName} >\n `
262
264
})
263
265
}
264
266
@@ -391,10 +393,10 @@ export default {
391
393
arrOfChildComp .forEach (childName => {
392
394
// Build child component text string
393
395
if (childName !== arrOfChildComp[arrOfChildComp .length - 1 ]){
394
- childrenComponentNames += " " + childName + " ,\n " ;
396
+ childrenComponentNames += " " + childName + " ,\n " ;
395
397
}
396
398
else {
397
- childrenComponentNames += " " + childName + " \n " ;
399
+ childrenComponentNames += " " + childName + " \n " ;
398
400
}
399
401
400
402
// Build child component import text string
@@ -407,10 +409,10 @@ export default {
407
409
return ` \n\n <script lang="ts">\n import { defineComponent } from "vue";\n ${ str} \n export default defineComponent ({\n name: '${ componentName} ',\n components: {\n ${ childrenComponentNames} }\n });\n <\/ script>` ;
408
410
}
409
411
str += " \n\n <script>" ;
410
- str += ` \n ${ childComponentImportNames} ` ;
412
+ str += ` ${ childComponentImportNames} ` ;
411
413
str += ` \n\n export default {`
412
414
str += ` \n components: {`
413
- str += ` \n ${ childrenComponentNames} }\n };` ;
415
+ str += ` \n ${ childrenComponentNames} }\n };` ;
414
416
str += ` \n <\/ script>` ;
415
417
return str
416
418
}
0 commit comments