Skip to content
This repository was archived by the owner on May 8, 2025. It is now read-only.

Commit d93e60b

Browse files
feat: generate typescript vue files for ts projects
fixes #66
1 parent 5985630 commit d93e60b

File tree

9 files changed

+342
-78
lines changed

9 files changed

+342
-78
lines changed
File renamed without changes.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<template>
2+
<v-app>
3+
<v-toolbar 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>
8+
<v-spacer></v-spacer>
9+
<v-btn
10+
flat
11+
href="https://github.com/vuetifyjs/vuetify/releases/latest"
12+
target="_blank"
13+
>
14+
<span class="mr-2">Latest Release</span>
15+
<%_ if (options.iconFont === 'mdi') { _%>
16+
<v-icon>mdi-open-in-new</v-icon>
17+
<%_ } else if (options.iconFont === 'md') { _%>
18+
<v-icon>open_in_new</v-icon>
19+
<%_ } else if (options.iconFont === 'fa') { _%>
20+
<v-icon>fas fa-external-link-alt</v-icon>
21+
<%_ } else if (options.iconFont === 'fa4') { _%>
22+
<v-icon>fa-external-link</v-icon>
23+
<%_ } _%>
24+
</v-btn>
25+
</v-toolbar>
26+
27+
<v-content>
28+
<%_ if (options.router) { _%>
29+
<router-view/>
30+
<%_ } else { _%>
31+
<HelloWorld/>
32+
<%_ } _%>
33+
</v-content>
34+
</v-app>
35+
</template>
36+
37+
<script lang="ts">
38+
import Vue from 'vue'
39+
<%_ if (!options.router) { _%>
40+
import HelloWorld from './components/HelloWorld.vue'
41+
<%_ } _%>
42+
43+
export default Vue.extend({
44+
name: 'App',
45+
<%_ if (!options.router) { _%>
46+
components: {
47+
HelloWorld
48+
},
49+
<%_ } _%>
50+
data () {
51+
return {
52+
//
53+
}
54+
}
55+
})
56+
</script>

generator/templates/default/src/components/HelloWorld.vue renamed to generator/templates/default/src/components/HelloWorld.js.vue

Lines changed: 54 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -85,63 +85,59 @@
8585
</template>
8686

8787
<script>
88-
export default {
89-
data: () => ({
90-
ecosystem: [
91-
{
92-
text: 'vuetify-loader',
93-
href: 'https://github.com/vuetifyjs/vuetify-loader'
94-
},
95-
{
96-
text: 'github',
97-
href: 'https://github.com/vuetifyjs/vuetify'
98-
},
99-
{
100-
text: 'awesome-vuetify',
101-
href: 'https://github.com/vuetifyjs/awesome-vuetify'
102-
}
103-
],
104-
importantLinks: [
105-
{
106-
text: 'Documentation',
107-
href: 'https://vuetifyjs.com'
108-
},
109-
{
110-
text: 'Chat',
111-
href: 'https://community.vuetifyjs.com'
112-
},
113-
{
114-
text: 'Made with Vuetify',
115-
href: 'https://madewithvuetifyjs.com'
116-
},
117-
{
118-
text: 'Twitter',
119-
href: 'https://twitter.com/vuetifyjs'
120-
},
121-
{
122-
text: 'Articles',
123-
href: 'https://medium.com/vuetify'
124-
}
125-
],
126-
whatsNext: [
127-
{
128-
text: 'Explore components',
129-
href: 'https://vuetifyjs.com/components/api-explorer'
130-
},
131-
{
132-
text: 'Select a layout',
133-
href: 'https://vuetifyjs.com/layout/pre-defined'
134-
},
135-
{
136-
text: 'Frequently Asked Questions',
137-
href: 'https://vuetifyjs.com/getting-started/frequently-asked-questions'
138-
}
88+
export default {
89+
data: () => ({
90+
ecosystem: [
91+
{
92+
text: 'vuetify-loader',
93+
href: 'https://github.com/vuetifyjs/vuetify-loader'
94+
},
95+
{
96+
text: 'github',
97+
href: 'https://github.com/vuetifyjs/vuetify'
98+
},
99+
{
100+
text: 'awesome-vuetify',
101+
href: 'https://github.com/vuetifyjs/awesome-vuetify'
102+
}
103+
],
104+
importantLinks: [
105+
{
106+
text: 'Documentation',
107+
href: 'https://vuetifyjs.com'
108+
},
109+
{
110+
text: 'Chat',
111+
href: 'https://community.vuetifyjs.com'
112+
},
113+
{
114+
text: 'Made with Vuetify',
115+
href: 'https://madewithvuetifyjs.com'
116+
},
117+
{
118+
text: 'Twitter',
119+
href: 'https://twitter.com/vuetifyjs'
120+
},
121+
{
122+
text: 'Articles',
123+
href: 'https://medium.com/vuetify'
124+
}
125+
],
126+
whatsNext: [
127+
{
128+
text: 'Explore components',
129+
href: 'https://vuetifyjs.com/components/api-explorer'
130+
},
131+
{
132+
text: 'Select a layout',
133+
href: 'https://vuetifyjs.com/layout/pre-defined'
134+
},
135+
{
136+
text: 'Frequently Asked Questions',
137+
href: 'https://vuetifyjs.com/getting-started/frequently-asked-questions'
138+
}
139139
140-
]
141-
})
142-
}
140+
]
141+
})
142+
}
143143
</script>
144-
145-
<style>
146-
147-
</style>
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
<template>
2+
<v-container>
3+
<v-layout
4+
text-xs-center
5+
wrap
6+
>
7+
<v-flex xs12>
8+
<v-img
9+
:src="require('../assets/logo.svg')"
10+
class="my-3"
11+
contain
12+
height="200"
13+
></v-img>
14+
</v-flex>
15+
16+
<v-flex mb-4>
17+
<h1 class="display-2 font-weight-bold mb-3">
18+
Welcome to Vuetify
19+
</h1>
20+
<p class="subheading font-weight-regular">
21+
For help and collaboration with other Vuetify developers,
22+
<br>please join our online
23+
<a href="https://community.vuetifyjs.com" target="_blank">Discord Community</a>
24+
</p>
25+
</v-flex>
26+
27+
<v-flex
28+
mb-5
29+
xs12
30+
>
31+
<h2 class="headline font-weight-bold mb-3">What's next?</h2>
32+
33+
<v-layout justify-center>
34+
<a
35+
v-for="(next, i) in assets.whatsNext"
36+
:key="i"
37+
:href="next.href"
38+
class="subheading mx-3"
39+
target="_blank"
40+
>
41+
{{ next.text }}
42+
</a>
43+
</v-layout>
44+
</v-flex>
45+
46+
<v-flex
47+
xs12
48+
mb-5
49+
>
50+
<h2 class="headline font-weight-bold mb-3">Important Links</h2>
51+
52+
<v-layout justify-center>
53+
<a
54+
v-for="(link, i) in assets.importantLinks"
55+
:key="i"
56+
:href="link.href"
57+
class="subheading mx-3"
58+
target="_blank"
59+
>
60+
{{ link.text }}
61+
</a>
62+
</v-layout>
63+
</v-flex>
64+
65+
<v-flex
66+
xs12
67+
mb-5
68+
>
69+
<h2 class="headline font-weight-bold mb-3">Ecosystem</h2>
70+
71+
<v-layout justify-center>
72+
<a
73+
v-for="(eco, i) in assets.ecosystem"
74+
:key="i"
75+
:href="eco.href"
76+
class="subheading mx-3"
77+
target="_blank"
78+
>
79+
{{ eco.text }}
80+
</a>
81+
</v-layout>
82+
</v-flex>
83+
</v-layout>
84+
</v-container>
85+
</template>
86+
87+
<script lang="ts">
88+
import Vue from 'vue'
89+
90+
export default Vue.extend({
91+
data: () => ({
92+
ecosystem: [
93+
{
94+
text: 'vuetify-loader',
95+
href: 'https://github.com/vuetifyjs/vuetify-loader'
96+
},
97+
{
98+
text: 'github',
99+
href: 'https://github.com/vuetifyjs/vuetify'
100+
},
101+
{
102+
text: 'awesome-vuetify',
103+
href: 'https://github.com/vuetifyjs/awesome-vuetify'
104+
}
105+
],
106+
importantLinks: [
107+
{
108+
text: 'Documentation',
109+
href: 'https://vuetifyjs.com'
110+
},
111+
{
112+
text: 'Chat',
113+
href: 'https://community.vuetifyjs.com'
114+
},
115+
{
116+
text: 'Made with Vuetify',
117+
href: 'https://madewithvuetifyjs.com'
118+
},
119+
{
120+
text: 'Twitter',
121+
href: 'https://twitter.com/vuetifyjs'
122+
},
123+
{
124+
text: 'Articles',
125+
href: 'https://medium.com/vuetify'
126+
}
127+
],
128+
whatsNext: [
129+
{
130+
text: 'Explore components',
131+
href: 'https://vuetifyjs.com/components/api-explorer'
132+
},
133+
{
134+
text: 'Select a layout',
135+
href: 'https://vuetifyjs.com/layout/pre-defined'
136+
},
137+
{
138+
text: 'Frequently Asked Questions',
139+
href: 'https://vuetifyjs.com/getting-started/frequently-asked-questions'
140+
}
141+
142+
]
143+
})
144+
})
145+
</script>
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"ecosystem": [
3+
{
4+
"text": "vuetify-loader",
5+
"href": "https://github.com/vuetifyjs/vuetify-loader"
6+
},
7+
{
8+
"text": "github",
9+
"href": "https://github.com/vuetifyjs/vuetify"
10+
},
11+
{
12+
"text": "awesome-vuetify",
13+
"href": "https://github.com/vuetifyjs/awesome-vuetify"
14+
}
15+
],
16+
"importantLinks": [
17+
{
18+
"text": "Documentation",
19+
"href": "https://vuetifyjs.com"
20+
},
21+
{
22+
"text": "Chat",
23+
"href": "https://community.vuetifyjs.com"
24+
},
25+
{
26+
"text": "Made with Vuetify",
27+
"href": "https://madewithvuetifyjs.com"
28+
},
29+
{
30+
"text": "Twitter",
31+
"href": "https://twitter.com/vuetifyjs"
32+
},
33+
{
34+
"text": "Articles",
35+
"href": "https://medium.com/vuetify"
36+
}
37+
],
38+
"whatsNext": [
39+
{
40+
"text": "Explore components",
41+
"href": "https://vuetifyjs.com/components/api-explorer"
42+
},
43+
{
44+
"text": "Select a layout",
45+
"href": "https://vuetifyjs.com/layout/pre-defined"
46+
},
47+
{
48+
"text": "Frequently Asked Questions",
49+
"href": "https://vuetifyjs.com/getting-started/frequently-asked-questions"
50+
}
51+
]
52+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<template>
2+
<HelloWorld />
3+
</template>
4+
5+
<script>
6+
import HelloWorld from '../components/HelloWorld'
7+
8+
export default {
9+
components: {
10+
HelloWorld
11+
}
12+
}
13+
</script>

0 commit comments

Comments
 (0)