Skip to content

Commit

Permalink
refactor(templates): clean-up file structure and process
Browse files Browse the repository at this point in the history
  • Loading branch information
johnleider committed Nov 3, 2019
1 parent ca0a0b4 commit b7a7351
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 11 deletions.
2 changes: 2 additions & 0 deletions generator/templates/default/src/App.js.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,12 @@ import HelloWorld from './components/HelloWorld';
export default {
name: 'App',
<%_ if (!opts.router) { _%>
components: {
HelloWorld,
},
<%_ } _%>
data: () => ({
//
Expand Down
45 changes: 34 additions & 11 deletions generator/templates/default/src/App.ts.vue
Original file line number Diff line number Diff line change
@@ -1,31 +1,52 @@
<template>
<v-app>
<v-app-bar app>
<v-toolbar-title class="headline text-uppercase">
<span>Vuetify</span>
<span class="font-weight-light">MATERIAL DESIGN</span>
</v-toolbar-title>
<v-app-bar
app
color="primary"
dark
>
<div class="d-flex align-center">
<v-img
alt="Vuetify Logo"
class="shrink mr-2"
contain
src="https://cdn.vuetifyjs.com/images/logos/vuetify-logo-dark.png"
transition="scale-transition"
width="40"
/>

<v-img
alt="Vuetify Name"
class="shrink mt-1 hidden-sm-and-down"
contain
min-width="100"
src="https://cdn.vuetifyjs.com/images/logos/vuetify-name-dark.png"
width="100"
/>
</div>

<v-spacer></v-spacer>

<v-btn
text
href="https://github.com/vuetifyjs/vuetify/releases/latest"
target="_blank"
text
>
<span class="mr-2">Latest Release</span>
<%_ if (options.iconFont === 'mdi') { _%>
<%_ if (opts.iconFont === 'mdi') { _%>
<v-icon>mdi-open-in-new</v-icon>
<%_ } else if (options.iconFont === 'md') { _%>
<%_ } else if (opts.iconFont === 'md') { _%>
<v-icon>open_in_new</v-icon>
<%_ } else if (options.iconFont === 'fa') { _%>
<%_ } else if (opts.iconFont === 'fa') { _%>
<v-icon>fas fa-external-link-alt</v-icon>
<%_ } else if (options.iconFont === 'fa4') { _%>
<%_ } else if (opts.iconFont === 'fa4') { _%>
<v-icon>fa-external-link</v-icon>
<%_ } _%>
</v-btn>
</v-app-bar>

<v-content>
<%_ if (options.router) { _%>
<%_ if (opts.router) { _%>
<router-view/>
<%_ } else { _%>
<HelloWorld/>
Expand All @@ -42,10 +63,12 @@ import HelloWorld from './components/HelloWorld.vue';
export default Vue.extend({
name: 'App',
<%_ if (!options.router) { _%>
components: {
HelloWorld,
},
<%_ } _%>
data: () => ({
//
Expand Down
2 changes: 2 additions & 0 deletions generator/templates/default/src/components/HelloWorld.js.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@

<script>
export default {
name: 'HelloWorld',
data: () => ({
ecosystem: [
{
Expand Down
2 changes: 2 additions & 0 deletions generator/templates/default/src/components/HelloWorld.ts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
import Vue from 'vue';
export default Vue.extend({
name: 'HelloWorld',
data: () => ({
ecosystem: [
{
Expand Down
2 changes: 2 additions & 0 deletions generator/templates/default/src/plugins/vuetify.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ export default new Vuetify({
current: '<%= locale %>',
},
<%_ } _%>
<%_ if (opts.iconFont !== 'mdi') { _%>
icons: {
iconfont: '<%= opts.iconFont %>',
},
<%_ } _%>
});
2 changes: 2 additions & 0 deletions generator/templates/default/src/views/Home.js.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import HelloWorld from '../components/HelloWorld';
export default {
name: 'Home',
components: {
HelloWorld,
},
Expand Down
2 changes: 2 additions & 0 deletions generator/templates/default/src/views/Home.ts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import Vue from 'vue';
import HelloWorld from '../components/HelloWorld.vue';
export default Vue.extend({
name: 'Home',
components: {
HelloWorld,
},
Expand Down

0 comments on commit b7a7351

Please sign in to comment.