Skip to content

Commit ca0a0b4

Browse files
committed
fix: update opts parameter syntax
options were not being properly applied to templates
1 parent 2c02520 commit ca0a0b4

File tree

3 files changed

+42
-21
lines changed

3 files changed

+42
-21
lines changed

generator/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = (api, opts) => {
2525
if (opts.installFonts) fonts.addDependencies(api, opts.iconFont)
2626

2727
// Update templates
28-
vuetify.renderFiles(api, opts)
28+
vuetify.renderFiles(api, { opts })
2929

3030
// adapted from https://github.com/Akryum/vue-cli-plugin-apollo/blob/master/generator/index.js#L68-L91
3131
api.onCreateComplete(() => {

generator/templates/default/src/App.js.vue

+34-13
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,52 @@
11
<template>
22
<v-app>
3-
<v-app-bar app>
4-
<v-toolbar-title class="headline text-uppercase">
5-
<span>Vuetify</span>
6-
<span class="font-weight-light">MATERIAL DESIGN</span>
7-
</v-toolbar-title>
3+
<v-app-bar
4+
app
5+
color="primary"
6+
dark
7+
>
8+
<div class="d-flex align-center">
9+
<v-img
10+
alt="Vuetify Logo"
11+
class="shrink mr-2"
12+
contain
13+
src="https://cdn.vuetifyjs.com/images/logos/vuetify-logo-dark.png"
14+
transition="scale-transition"
15+
width="40"
16+
/>
17+
18+
<v-img
19+
alt="Vuetify Name"
20+
class="shrink mt-1 hidden-sm-and-down"
21+
contain
22+
min-width="100"
23+
src="https://cdn.vuetifyjs.com/images/logos/vuetify-name-dark.png"
24+
width="100"
25+
/>
26+
</div>
27+
828
<v-spacer></v-spacer>
29+
930
<v-btn
10-
text
1131
href="https://github.com/vuetifyjs/vuetify/releases/latest"
1232
target="_blank"
33+
text
1334
>
1435
<span class="mr-2">Latest Release</span>
15-
<%_ if (options.iconFont === 'mdi') { _%>
36+
<%_ if (opts.iconFont === 'mdi') { _%>
1637
<v-icon>mdi-open-in-new</v-icon>
17-
<%_ } else if (options.iconFont === 'md') { _%>
38+
<%_ } else if (opts.iconFont === 'md') { _%>
1839
<v-icon>open_in_new</v-icon>
19-
<%_ } else if (options.iconFont === 'fa') { _%>
40+
<%_ } else if (opts.iconFont === 'fa') { _%>
2041
<v-icon>fas fa-external-link-alt</v-icon>
21-
<%_ } else if (options.iconFont === 'fa4') { _%>
42+
<%_ } else if (opts.iconFont === 'fa4') { _%>
2243
<v-icon>fa-external-link</v-icon>
2344
<%_ } _%>
2445
</v-btn>
2546
</v-app-bar>
2647

2748
<v-content>
28-
<%_ if (options.router) { _%>
49+
<%_ if (opts.router) { _%>
2950
<router-view/>
3051
<%_ } else { _%>
3152
<HelloWorld/>
@@ -35,13 +56,13 @@
3556
</template>
3657

3758
<script>
38-
<%_ if (!options.router) { _%>
59+
<%_ if (!opts.router) { _%>
3960
import HelloWorld from './components/HelloWorld';
4061
<%_ } _%>
4162
4263
export default {
4364
name: 'App',
44-
<%_ if (!options.router) { _%>
65+
<%_ if (!opts.router) { _%>
4566
components: {
4667
HelloWorld,
4768
},

generator/templates/default/src/plugins/vuetify.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import Vue from 'vue';
2-
<%_ if (useAlaCarte) { _%>
2+
<%_ if (opts.useAlaCarte) { _%>
33
import Vuetify from 'vuetify/lib';
44
<%_ } else { _%>
55
import Vuetify from 'vuetify';
66
import 'vuetify/dist/vuetify.min.css';
77
<%_ } _%>
8-
<%_ if (locale !== 'en') { _%>
8+
<%_ if (opts.locale !== 'en') { _%>
99
import <%= locale.replace(/-/g, '') %> from 'vuetify/<%= typescript ? 'src' : 'es5' %>/locale/<%= locale %>';
1010
<%_ } _%>
1111

1212
Vue.use(Vuetify);
1313

1414
export default new Vuetify({
15-
<%_ if (useTheme) { _%>
15+
<%_ if (opts.useTheme) { _%>
1616
theme: {
17-
<%_ if (useCustomProperties) { _%>
17+
<%_ if (opts.useCustomProperties) { _%>
1818
options: {
1919
customProperties: true,
2020
},
@@ -32,13 +32,13 @@ export default new Vuetify({
3232
},
3333
},
3434
<%_ } _%>
35-
<%_ if (locale !== 'en') { _%>
35+
<%_ if (opts.locale !== 'en') { _%>
3636
lang: {
37-
locales: { <%= locale.replace(/-/g, '') %> },
37+
locales: { <%= opts.locale.replace(/-/g, '') %> },
3838
current: '<%= locale %>',
3939
},
4040
<%_ } _%>
4141
icons: {
42-
iconfont: '<%= iconFont %>',
42+
iconfont: '<%= opts.iconFont %>',
4343
},
4444
});

0 commit comments

Comments
 (0)