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

Commit 85af118

Browse files
committed
refactor(templates): clean up templates, enable router for v3.
1 parent f5a4f51 commit 85af118

File tree

6 files changed

+81
-74
lines changed

6 files changed

+81
-74
lines changed

packages/vue-cli-plugin-vuetify/generator/templates/v3/src/App.js.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
<script>
1414
<%_ if (!router) { _%>
15-
import HelloWorld from './components/HelloWorld';
15+
import HelloWorld from './components/HelloWorld.vue';
1616
<%_ } _%>
1717
1818
export default {

packages/vue-cli-plugin-vuetify/generator/templates/v3/src/components/HelloWorld.js.vue

Lines changed: 54 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<v-row class="text-center">
44
<v-col cols="12">
55
<v-img
6-
:src="require('../assets/logo.svg')"
6+
:src="logo"
77
class="my-3"
88
contain
99
height="200"
@@ -92,57 +92,59 @@
9292
</template>
9393

9494
<script>
95+
import logo from '../assets/logo.svg';
9596
96-
export default {
97-
name: 'Playground',
97+
export default {
98+
name: 'Playground',
9899
99-
data: () => ({
100-
ecosystem: [
101-
{
102-
text: 'vuetify-loader',
103-
href: 'https://github.com/vuetifyjs/vuetify-loader',
104-
},
105-
{
106-
text: 'github',
107-
href: 'https://github.com/vuetifyjs/vuetify',
108-
},
109-
{
110-
text: 'awesome-vuetify',
111-
href: 'https://github.com/vuetifyjs/awesome-vuetify',
112-
},
113-
],
114-
importantLinks: [
115-
{
116-
text: 'Chat',
117-
href: 'https://community.vuetifyjs.com',
118-
},
119-
{
120-
text: 'Made with Vuetify',
121-
href: 'https://madewithvuejs.com/vuetify',
122-
},
123-
{
124-
text: 'Twitter',
125-
href: 'https://twitter.com/vuetifyjs',
126-
},
127-
{
128-
text: 'Articles',
129-
href: 'https://medium.com/vuetify',
130-
},
131-
],
132-
whatsNext: [
133-
{
134-
text: 'Explore components',
135-
href: 'https://vuetifyjs.com',
136-
},
137-
{
138-
text: 'Roadmap',
139-
href: 'https://vuetifyjs.com/en/introduction/roadmap/',
140-
},
141-
{
142-
text: 'Frequently Asked Questions',
143-
href: 'https://vuetifyjs.com/getting-started/frequently-asked-questions',
144-
},
145-
],
146-
}),
147-
}
100+
data: () => ({
101+
ecosystem: [
102+
{
103+
text: 'vuetify-loader',
104+
href: 'https://github.com/vuetifyjs/vuetify-loader',
105+
},
106+
{
107+
text: 'github',
108+
href: 'https://github.com/vuetifyjs/vuetify',
109+
},
110+
{
111+
text: 'awesome-vuetify',
112+
href: 'https://github.com/vuetifyjs/awesome-vuetify',
113+
},
114+
],
115+
importantLinks: [
116+
{
117+
text: 'Chat',
118+
href: 'https://community.vuetifyjs.com',
119+
},
120+
{
121+
text: 'Made with Vuetify',
122+
href: 'https://madewithvuejs.com/vuetify',
123+
},
124+
{
125+
text: 'Twitter',
126+
href: 'https://twitter.com/vuetifyjs',
127+
},
128+
{
129+
text: 'Articles',
130+
href: 'https://medium.com/vuetify',
131+
},
132+
],
133+
logo,
134+
whatsNext: [
135+
{
136+
text: 'Explore components',
137+
href: 'https://vuetifyjs.com',
138+
},
139+
{
140+
text: 'Roadmap',
141+
href: 'https://vuetifyjs.com/en/introduction/roadmap/',
142+
},
143+
{
144+
text: 'Frequently Asked Questions',
145+
href: 'https://vuetifyjs.com/getting-started/frequently-asked-questions',
146+
},
147+
],
148+
}),
149+
}
148150
</script>
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
import { createApp } from "vue";
2-
import vuetify from "./plugins/vuetify";
3-
import App from "./App";
1+
import { createApp } from 'vue'
2+
import vuetify from './plugins/vuetify'
3+
import App from './App'
4+
<_% if (router) { %_>
5+
import router from './router'
6+
<_% } %_>
47

5-
const app = createApp(App);
8+
const app = createApp(App)
9+
<_% if (router) { %_>
10+
app.use(router)
11+
<_% } %_>
12+
app.use(vuetify)
613

7-
app.use(vuetify);
8-
9-
app.mount("#app");
14+
app.mount('#app')
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import "@mdi/font/css/materialdesignicons.css";
2-
import "vuetify/lib/styles/main.sass";
3-
import { createVuetify } from "vuetify";
4-
import * as components from "vuetify/lib/components";
5-
import * as directives from "vuetify/lib/directives";
1+
import '@mdi/font/css/materialdesignicons.css'
2+
import 'vuetify/lib/styles/main.sass'
3+
import { createVuetify } from 'vuetify'
4+
import * as components from 'vuetify/lib/components'
5+
import * as directives from 'vuetify/lib/directives'
66

77
export default createVuetify({
88
components,
99
directives,
10-
});
10+
})

packages/vue-cli-plugin-vuetify/generator/templates/v3/src/views/Home.js.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
</template>
66

77
<script>
8-
import HelloWorld from '../components/HelloWorld.vue'
8+
import HelloWorld from '../components/HelloWorld.vue';
99
10-
export default {
11-
name: 'Home',
12-
13-
components: {
14-
HelloWorld,
15-
},
16-
}
10+
export default {
11+
name: 'Home',
12+
13+
components: {
14+
HelloWorld,
15+
},
16+
};
1717
</script>

0 commit comments

Comments
 (0)