Skip to content

Commit b485595

Browse files
committed
Updated generic SFC template with latest structure
1 parent f07b117 commit b485595

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

Diff for: generator/templates/vue-sfc-template.vue

+19-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,28 @@
1+
<%_ if (rootOptions.router) { _%>
2+
<%# -------------------- IS Using vue-router -------------------- -%>
13
<template></template>
2-
<%_ if (!usingTS) { _%>
3-
<%# -------------------- Is Not Using TypeScript -------------------- -%>
4+
<%_ } else { _%>
5+
<%# -------------------- IS NOT Using vue-router -------------------- -%>
6+
<template></template>
7+
<%_ } _%>
8+
<%_ if (!usingTS && rootOptions.router) { _%>
9+
<%# -------------------- IS NOT Using TypeScript AND IS Using vue-router -------------------- -%>
410
<%# Remove this line and Uncomment the next to use script tag - Prettier formatting bug removes all script tags if these are left in -%>
511
<%# <script></script> -%>
6-
<%_ } else { _%>
7-
<%# -------------------- Is Using TypeScript -------------------- -%>
12+
<%_ } else if (!usingTS && !rootOptions.router) { _%>
13+
<%# -------------------- IS NOT Using TypeScript AND IS NOT Using vue-router -------------------- -%>
814
<%# Remove this line and Uncomment the next to use script tag - Prettier formatting bug removes all script tags if these are left in -%>
15+
<%# <script></script> -%>
16+
<%_ } else if (usingTS && rootOptions.router) { _%>
17+
<%# -------------------- IS Using TypeScript AND IS Using vue-router -------------------- -%>
18+
<%# <script lang="ts"></script> -%>
19+
<%_ } else if (usingTS && !rootOptions.router) { _%>
20+
<%# -------------------- IS Using TypeScript AND IS NOT Using vue-router -------------------- -%>
921
<%# <script lang="ts"></script> -%>
22+
<%_ } else { _%>
23+
<%# -------------------- don't do anything -------------------- -%>
1024
<%_ } _%>
11-
<!-- Add "scoped" attribute to limit CSS to this component only -->
25+
<!-- Add "scoped" attribute to limit CSS to this component only -->
1226
<%_ if (rootOptions.cssPreprocessor) { _%>
1327
<%_ if (rootOptions.cssPreprocessor !== 'stylus') { _%>
1428
<%# -------------------- IS Using scss OR sass -------------------- -%>

0 commit comments

Comments
 (0)