Skip to content

Commit b6a5c0e

Browse files
committed
Add vuetify
1 parent f1fe9f5 commit b6a5c0e

File tree

6 files changed

+49
-4
lines changed

6 files changed

+49
-4
lines changed

app.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<template>
2-
<div>
3-
<NuxtWelcome />
4-
</div>
2+
<NuxtLayout>
3+
<v-app>
4+
<NuxtPage />
5+
</v-app>
6+
</NuxtLayout>
57
</template>

bun.lockb

2.1 KB
Binary file not shown.

nuxt.config.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
1+
import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
2+
13
// https://nuxt.com/docs/api/configuration/nuxt-config
24
export default defineNuxtConfig({
3-
devtools: { enabled: true }
5+
devtools: { enabled: true },
6+
build: {
7+
transpile: ['vuetify'],
8+
},
9+
modules: [
10+
(_options, nuxt) => {
11+
nuxt.hooks.hook('vite:extendConfig', (config) => {
12+
// @ts-expect-error
13+
config.plugins.push(vuetify({ autoImport: true }))
14+
})
15+
},
16+
//...
17+
],
18+
vite: {
19+
vue: {
20+
template: {
21+
transformAssetUrls,
22+
},
23+
},
24+
},
425
})

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@
1010
"postinstall": "nuxt prepare"
1111
},
1212
"dependencies": {
13+
"@mdi/font": "^7.4.47",
1314
"nuxt": "^3.11.1",
1415
"vue": "^3.4.21",
1516
"vue-router": "^4.3.0"
17+
},
18+
"devDependencies": {
19+
"vite-plugin-vuetify": "^2.0.3",
20+
"vuetify": "^3.5.14"
1621
}
1722
}

pages/index.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<v-app-bar :elevation="2">
3+
<v-app-bar-title>Osaka RubyKaigi 2024</v-app-bar-title>
4+
</v-app-bar>
5+
</template>

plugins/vuetify.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// import this after install `@mdi/font` package
2+
import '@mdi/font/css/materialdesignicons.css'
3+
4+
import 'vuetify/styles'
5+
import { createVuetify } from 'vuetify'
6+
7+
export default defineNuxtPlugin((app) => {
8+
const vuetify = createVuetify({
9+
// ... your configuration
10+
})
11+
app.vueApp.use(vuetify)
12+
})

0 commit comments

Comments
 (0)