Skip to content

Commit

Permalink
fix: properly load opts
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Nov 3, 2019
1 parent b26e592 commit 3207aab
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
14 changes: 7 additions & 7 deletions generator/templates/default/src/App.js.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@
text
>
<span class="mr-2">Latest Release</span>
<%_ if (opts.iconFont === 'mdi') { _%>
<%_ if (iconFont === 'mdi') { _%>
<v-icon>mdi-open-in-new</v-icon>
<%_ } else if (opts.iconFont === 'md') { _%>
<%_ } else if (iconFont === 'md') { _%>
<v-icon>open_in_new</v-icon>
<%_ } else if (opts.iconFont === 'fa') { _%>
<%_ } else if (iconFont === 'fa') { _%>
<v-icon>fas fa-external-link-alt</v-icon>
<%_ } else if (opts.iconFont === 'fa4') { _%>
<%_ } else if (iconFont === 'fa4') { _%>
<v-icon>fa-external-link</v-icon>
<%_ } _%>
</v-btn>
</v-app-bar>

<v-content>
<%_ if (opts.router) { _%>
<%_ if (router) { _%>
<router-view/>
<%_ } else { _%>
<HelloWorld/>
Expand All @@ -56,14 +56,14 @@
</template>

<script>
<%_ if (!opts.router) { _%>
<%_ if (!router) { _%>
import HelloWorld from './components/HelloWorld';
<%_ } _%>
export default {
name: 'App',
<%_ if (!opts.router) { _%>
<%_ if (!router) { _%>
components: {
HelloWorld,
},
Expand Down
14 changes: 7 additions & 7 deletions generator/templates/default/src/App.ts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,20 @@
text
>
<span class="mr-2">Latest Release</span>
<%_ if (opts.iconFont === 'mdi') { _%>
<%_ if (iconFont === 'mdi') { _%>
<v-icon>mdi-open-in-new</v-icon>
<%_ } else if (opts.iconFont === 'md') { _%>
<%_ } else if (iconFont === 'md') { _%>
<v-icon>open_in_new</v-icon>
<%_ } else if (opts.iconFont === 'fa') { _%>
<%_ } else if (iconFont === 'fa') { _%>
<v-icon>fas fa-external-link-alt</v-icon>
<%_ } else if (opts.iconFont === 'fa4') { _%>
<%_ } else if (iconFont === 'fa4') { _%>
<v-icon>fa-external-link</v-icon>
<%_ } _%>
</v-btn>
</v-app-bar>

<v-content>
<%_ if (opts.router) { _%>
<%_ if (router) { _%>
<router-view/>
<%_ } else { _%>
<HelloWorld/>
Expand All @@ -57,14 +57,14 @@

<script lang="ts">
import Vue from 'vue';
<%_ if (!options.router) { _%>
<%_ if (!router) { _%>
import HelloWorld from './components/HelloWorld.vue';
<%_ } _%>
export default Vue.extend({
name: 'App',
<%_ if (!options.router) { _%>
<%_ if (!router) { _%>
components: {
HelloWorld,
},
Expand Down
16 changes: 8 additions & 8 deletions generator/templates/default/src/plugins/vuetify.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import Vue from 'vue';
<%_ if (opts.useAlaCarte) { _%>
<%_ if (useAlaCarte) { _%>
import Vuetify from 'vuetify/lib';
<%_ } else { _%>
import Vuetify from 'vuetify';
import 'vuetify/dist/vuetify.min.css';
<%_ } _%>
<%_ if (opts.locale !== 'en') { _%>
<%_ if (locale !== 'en') { _%>
import <%= locale.replace(/-/g, '') %> from 'vuetify/<%= typescript ? 'src' : 'es5' %>/locale/<%= locale %>';
<%_ } _%>

Vue.use(Vuetify);

export default new Vuetify({
<%_ if (opts.useTheme) { _%>
<%_ if (useTheme) { _%>
theme: {
<%_ if (opts.useCustomProperties) { _%>
<%_ if (useCustomProperties) { _%>
options: {
customProperties: true,
},
Expand All @@ -32,15 +32,15 @@ export default new Vuetify({
},
},
<%_ } _%>
<%_ if (opts.locale !== 'en') { _%>
<%_ if (locale !== 'en') { _%>
lang: {
locales: { <%= opts.locale.replace(/-/g, '') %> },
locales: { <%= locale.replace(/-/g, '') %> },
current: '<%= locale %>',
},
<%_ } _%>
<%_ if (opts.iconFont !== 'mdi') { _%>
<%_ if (iconFont !== 'mdi') { _%>
icons: {
iconfont: '<%= opts.iconFont %>',
iconfont: '<%= iconFont %>',
},
<%_ } _%>
});
2 changes: 1 addition & 1 deletion generator/tools/vuetify.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function addDependencies (api) {
})
}

function renderFiles (api, opts) {
function renderFiles (api, { opts }) {
const ext = api.hasPlugin('typescript') ? 'ts' : 'js'
const pluginFilename = `vuetify.${ext}`

Expand Down

0 comments on commit 3207aab

Please sign in to comment.