vuetify-nuxt-module 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +379 -321
- package/dist/module.json +1 -1
- package/dist/module.mjs +6 -7
- package/dist/runtime/plugins/vuetify-date.d.ts +2 -0
- package/dist/runtime/plugins/vuetify-date.mjs +7 -0
- package/dist/runtime/plugins/vuetify-i18n.d.ts +2 -0
- package/dist/runtime/plugins/vuetify-i18n.mjs +7 -0
- package/dist/runtime/plugins/vuetify-icons.d.ts +2 -0
- package/dist/runtime/plugins/vuetify-icons.mjs +7 -0
- package/dist/runtime/plugins/vuetify.d.ts +2 -0
- package/dist/runtime/plugins/vuetify.mjs +11 -0
- package/package.json +3 -3
- package/dist/runtime/plugins/vuetify-date.mts +0 -8
- package/dist/runtime/plugins/vuetify-i18n.mts +0 -8
- package/dist/runtime/plugins/vuetify-icons.mts +0 -8
- package/dist/runtime/plugins/vuetify.mts +0 -11
package/README.md
CHANGED
|
@@ -1,321 +1,379 @@
|
|
|
1
|
-
<div align="center">
|
|
2
|
-
<picture>
|
|
3
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/userquin/vuetify-nuxt-module/raw/main/hero-dark.svg" />
|
|
4
|
-
<img alt="vuetify-nuxt-module - Zero-config Nuxt module for Vuetify" src='https://github.com/userquin/vuetify-nuxt-module/raw/main/hero.svg' alt="vuetify-nuxt-module - Zero-config Nuxt module for Vuetify"><br>
|
|
5
|
-
</picture>
|
|
6
|
-
<p>Zero-config Nuxt module for Vuetify</p>
|
|
7
|
-
</div>
|
|
8
|
-
|
|
9
|
-
<p align='center'>
|
|
10
|
-
<a href='https://www.npmjs.com/package/vuetify-nuxt-module' target="__blank">
|
|
11
|
-
<img src='https://img.shields.io/npm/v/vuetify-nuxt-module?color=33A6B8&label=' alt="NPM version">
|
|
12
|
-
</a>
|
|
13
|
-
<a href="https://www.npmjs.com/package/vuetify-nuxt-module" target="__blank">
|
|
14
|
-
<img alt="NPM Downloads" src="https://img.shields.io/npm/dm/vuetify-nuxt-module?color=476582&label=">
|
|
15
|
-
</a>
|
|
16
|
-
<!--
|
|
17
|
-
<a href="https://vite-pwa-org.netlify.app/frameworks/nuxt" target="__blank">
|
|
18
|
-
<img src="https://img.shields.io/static/v1?label=&message=docs%20%26%20guides&color=2e859c" alt="Docs & Guides">
|
|
19
|
-
</a>
|
|
20
|
-
-->
|
|
21
|
-
<br>
|
|
22
|
-
<a href="https://github.com/userquin/vuetify-nuxt-module" target="__blank">
|
|
23
|
-
<img alt="GitHub stars" src="https://img.shields.io/github/stars/userquin/vuetify-nuxt-module?style=social">
|
|
24
|
-
</a>
|
|
25
|
-
</p>
|
|
26
|
-
|
|
27
|
-
<br>
|
|
28
|
-
|
|
29
|
-
## 🚀 Features
|
|
30
|
-
|
|
31
|
-
- 👌 **Zero-Config**: sensible built-in default [Vuetify](https://vuetifyjs.com/) configuration for common use cases
|
|
32
|
-
- 🔩 **Extensible**: expose the ability to customize the Vuetify configuration via [Nuxt Plugin Hooks](https://nuxt.com/docs/guide/going-further/hooks#usage-with-plugins)
|
|
33
|
-
- ⚡ **Fully Tree Shakable**: by default, only the needed Vuetify components are imported
|
|
34
|
-
- 🛠️ **Versatile**: custom Vuetify [directives](https://vuetifyjs.com/en/getting-started/installation/#manual-steps) and [labs components](https://vuetifyjs.com/en/labs/introduction/) registration
|
|
35
|
-
- ✨ **Configurable Styles**: configure your variables using [Vuetify SASS Variables](https://vuetifyjs.com/en/features/sass-variables/)
|
|
36
|
-
- 💥 **SSR**: automatic SSR detection and configuration
|
|
37
|
-
- 😃 **Icon Fonts**: configure the [icon font](https://vuetifyjs.com/en/features/icon-fonts/) you want to use, the module will automatically import it for you using CDN or local dependencies
|
|
38
|
-
- 🎭 **SVG Icons**: ready to use [@mdi/js](https://www.npmjs.com/package/@mdi/js) and [@fortawesome/vue-fontawesome](https://www.npmjs.com/package/@fortawesome/vue-fontawesome) SVG icons packs
|
|
39
|
-
- 📦 **Multiple Icon Sets**: register [multiple icon sets](https://vuetifyjs.com/en/features/icon-fonts/#multiple-icon-sets)
|
|
40
|
-
- 🌍 **I18n Ready**: install [@nuxtjs/i18n](https://v8.i18n.nuxtjs.org/) Nuxt module, and you're ready to use Vuetify [internationalization](https://vuetifyjs.com/en/features/internationalization/) features
|
|
41
|
-
- 📆 **Date Components**: use Vuetify components [that require date functionality](https://vuetifyjs.com/en/features/dates/) installing and configuring one of the [@date-io](https://github.com/dmtrKovalenko/date-io#projects) adapters
|
|
42
|
-
- ⚙️ **Auto-Import Vuetify Composables**: you don't need to import Vuetify composables manually, they are automatically imported for you
|
|
43
|
-
- 🎨 **Vuetify Blueprints**: use [Vuetify Blueprints](https://vuetifyjs.com/en/features/blueprints/) to quickly scaffold components
|
|
44
|
-
- 🦾 **Type Strong**: written in [TypeScript](https://www.typescriptlang.org/)
|
|
45
|
-
|
|
46
|
-
## 📦 Install
|
|
47
|
-
|
|
48
|
-
> Requires Vite, will not work with Webpack
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
npm i vuetify-nuxt-module -D
|
|
52
|
-
|
|
53
|
-
# yarn
|
|
54
|
-
yarn add vuetify-nuxt-module -D
|
|
55
|
-
|
|
56
|
-
# pnpm
|
|
57
|
-
pnpm add vuetify-nuxt-module -D
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
[](https://stackblitz.com/github/userquin/vuetify-nuxt-module)
|
|
61
|
-
|
|
62
|
-
## 🦄 Usage
|
|
63
|
-
|
|
64
|
-
> `vuetify-nuxt-module` is strongly opinionated and has a built-in default configuration out of the box. You can use it without any configuration, and it will work for most use cases.
|
|
65
|
-
|
|
66
|
-
Add `vuetify-nuxt-module` module to `nuxt.config.ts` and configure it:
|
|
67
|
-
|
|
68
|
-
```ts
|
|
69
|
-
//
|
|
70
|
-
import { defineNuxtConfig } from 'nuxt/config'
|
|
71
|
-
|
|
72
|
-
export default defineNuxtConfig({
|
|
73
|
-
modules: [
|
|
74
|
-
'vuetify-nuxt-module'
|
|
75
|
-
],
|
|
76
|
-
vuetify: {
|
|
77
|
-
moduleOptions: {
|
|
78
|
-
/* module specific options */
|
|
79
|
-
},
|
|
80
|
-
vuetifyOptions: {
|
|
81
|
-
/* vuetify options */
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
})
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## 🔥 Components, Directives, Lab Components
|
|
88
|
-
|
|
89
|
-
The module will enable automatic tree shaking for Vuetify components.
|
|
90
|
-
|
|
91
|
-
You don't need to install any Vuetify Vite Plugin (the module will throw an error if any Vuetify Vite Plugin is installed in your Nuxt configuration):
|
|
92
|
-
- the module will provide auto-import support via `vuetify/dist/json/importMap.json` json file and Nuxt `components:extend` hook.
|
|
93
|
-
- the module will register a custom Vite Plugin for Vuetify styles: it is just a copy from the original Vuetify Vite Styles Plugin, changing some virtual names mappings and handling SSR flags.
|
|
94
|
-
|
|
95
|
-
### Global Components
|
|
96
|
-
|
|
97
|
-
If you need to add some global component, use `vuetifyOptions.components` module option, it has been declared properly to have better DX.
|
|
98
|
-
|
|
99
|
-
Check the [components definition](https://github.com/userquin/vuetify-nuxt-module/blob/main/src/types.ts#L80-L81).
|
|
100
|
-
|
|
101
|
-
You can also provide [Aliasing & Virtual Components](https://vuetifyjs.com/en/features/aliasing/#virtual-component-defaults) via `vuetifyOptions.aliases` module option to register components with a different name, only available for global components. The components require to be registered globally.
|
|
102
|
-
|
|
103
|
-
### Directives
|
|
104
|
-
|
|
105
|
-
By default, the module will not register any Vuetify directive. If you need to register some directive, use `vuetifyOptions.directives` module option, it has been declared properly to have better DX.
|
|
106
|
-
|
|
107
|
-
You can register all the directives or only the ones you need: check the [directives definition](https://github.com/userquin/vuetify-nuxt-module/blob/main/src/types.ts#L82-L83).
|
|
108
|
-
|
|
109
|
-
### Labs Components
|
|
110
|
-
|
|
111
|
-
The module provides support to use Vuetify [labs components](https://vuetifyjs.com/en/labs/introduction/) via `vuetifyOptions.labsComponents` module option, it has been declared properly to have better DX.
|
|
112
|
-
|
|
113
|
-
You can register all the labs components or only the ones you need: check the [labsComponent definition](https://github.com/userquin/vuetify-nuxt-module/blob/main/src/types.ts#L84-L85).
|
|
114
|
-
|
|
115
|
-
## 😃 Font Icons
|
|
116
|
-
|
|
117
|
-
This module supports the following font icons libraries:
|
|
118
|
-
- [Material Design Icons](https://materialdesignicons.com/)
|
|
119
|
-
- [Material Icons](https://fonts.google.com/icons)
|
|
120
|
-
- [Font Awesome 4](https://fontawesome.com/v4.7.0/)
|
|
121
|
-
- [Font Awesome 5](https://fontawesome.com/)
|
|
122
|
-
|
|
123
|
-
By default, the module will use the `mdi` font icon library. You can change it by setting the `defaultSet` option to:
|
|
124
|
-
- `mdi` for [Material Design Icons](https://materialdesignicons.com/)
|
|
125
|
-
- `md` for [Material Icons](https://fonts.google.com/icons)
|
|
126
|
-
- `fa4` for [Font Awesome 4](https://fontawesome.com/v4.7.0/)
|
|
127
|
-
- `fa` for [Font Awesome 5](https://fontawesome.com)
|
|
128
|
-
|
|
129
|
-
To configure a font icon you only need to specify the default set:
|
|
130
|
-
```ts
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
vuetify: {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
-
|
|
311
|
-
-
|
|
312
|
-
|
|
313
|
-
##
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/userquin/vuetify-nuxt-module/raw/main/hero-dark.svg" />
|
|
4
|
+
<img alt="vuetify-nuxt-module - Zero-config Nuxt module for Vuetify" src='https://github.com/userquin/vuetify-nuxt-module/raw/main/hero.svg' alt="vuetify-nuxt-module - Zero-config Nuxt module for Vuetify"><br>
|
|
5
|
+
</picture>
|
|
6
|
+
<p>Zero-config Nuxt module for Vuetify</p>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<p align='center'>
|
|
10
|
+
<a href='https://www.npmjs.com/package/vuetify-nuxt-module' target="__blank">
|
|
11
|
+
<img src='https://img.shields.io/npm/v/vuetify-nuxt-module?color=33A6B8&label=' alt="NPM version">
|
|
12
|
+
</a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/vuetify-nuxt-module" target="__blank">
|
|
14
|
+
<img alt="NPM Downloads" src="https://img.shields.io/npm/dm/vuetify-nuxt-module?color=476582&label=">
|
|
15
|
+
</a>
|
|
16
|
+
<!--
|
|
17
|
+
<a href="https://vite-pwa-org.netlify.app/frameworks/nuxt" target="__blank">
|
|
18
|
+
<img src="https://img.shields.io/static/v1?label=&message=docs%20%26%20guides&color=2e859c" alt="Docs & Guides">
|
|
19
|
+
</a>
|
|
20
|
+
-->
|
|
21
|
+
<br>
|
|
22
|
+
<a href="https://github.com/userquin/vuetify-nuxt-module" target="__blank">
|
|
23
|
+
<img alt="GitHub stars" src="https://img.shields.io/github/stars/userquin/vuetify-nuxt-module?style=social">
|
|
24
|
+
</a>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
<br>
|
|
28
|
+
|
|
29
|
+
## 🚀 Features
|
|
30
|
+
|
|
31
|
+
- 👌 **Zero-Config**: sensible built-in default [Vuetify](https://vuetifyjs.com/) configuration for common use cases
|
|
32
|
+
- 🔩 **Extensible**: expose the ability to customize the Vuetify configuration via [Nuxt Plugin Hooks](https://nuxt.com/docs/guide/going-further/hooks#usage-with-plugins)
|
|
33
|
+
- ⚡ **Fully Tree Shakable**: by default, only the needed Vuetify components are imported
|
|
34
|
+
- 🛠️ **Versatile**: custom Vuetify [directives](https://vuetifyjs.com/en/getting-started/installation/#manual-steps) and [labs components](https://vuetifyjs.com/en/labs/introduction/) registration
|
|
35
|
+
- ✨ **Configurable Styles**: configure your variables using [Vuetify SASS Variables](https://vuetifyjs.com/en/features/sass-variables/)
|
|
36
|
+
- 💥 **SSR**: automatic SSR detection and configuration
|
|
37
|
+
- 😃 **Icon Fonts**: configure the [icon font](https://vuetifyjs.com/en/features/icon-fonts/) you want to use, the module will automatically import it for you using CDN or local dependencies
|
|
38
|
+
- 🎭 **SVG Icons**: ready to use [@mdi/js](https://www.npmjs.com/package/@mdi/js) and [@fortawesome/vue-fontawesome](https://www.npmjs.com/package/@fortawesome/vue-fontawesome) SVG icons packs
|
|
39
|
+
- 📦 **Multiple Icon Sets**: register [multiple icon sets](https://vuetifyjs.com/en/features/icon-fonts/#multiple-icon-sets)
|
|
40
|
+
- 🌍 **I18n Ready**: install [@nuxtjs/i18n](https://v8.i18n.nuxtjs.org/) Nuxt module, and you're ready to use Vuetify [internationalization](https://vuetifyjs.com/en/features/internationalization/) features
|
|
41
|
+
- 📆 **Date Components**: use Vuetify components [that require date functionality](https://vuetifyjs.com/en/features/dates/) installing and configuring one of the [@date-io](https://github.com/dmtrKovalenko/date-io#projects) adapters
|
|
42
|
+
- ⚙️ **Auto-Import Vuetify Composables**: you don't need to import Vuetify composables manually, they are automatically imported for you
|
|
43
|
+
- 🎨 **Vuetify Blueprints**: use [Vuetify Blueprints](https://vuetifyjs.com/en/features/blueprints/) to quickly scaffold components
|
|
44
|
+
- 🦾 **Type Strong**: written in [TypeScript](https://www.typescriptlang.org/)
|
|
45
|
+
|
|
46
|
+
## 📦 Install
|
|
47
|
+
|
|
48
|
+
> Requires Vite, will not work with Webpack
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm i vuetify-nuxt-module -D
|
|
52
|
+
|
|
53
|
+
# yarn
|
|
54
|
+
yarn add vuetify-nuxt-module -D
|
|
55
|
+
|
|
56
|
+
# pnpm
|
|
57
|
+
pnpm add vuetify-nuxt-module -D
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
[](https://stackblitz.com/github/userquin/vuetify-nuxt-module)
|
|
61
|
+
|
|
62
|
+
## 🦄 Usage
|
|
63
|
+
|
|
64
|
+
> `vuetify-nuxt-module` is strongly opinionated and has a built-in default configuration out of the box. You can use it without any configuration, and it will work for most use cases.
|
|
65
|
+
|
|
66
|
+
Add `vuetify-nuxt-module` module to `nuxt.config.ts` and configure it:
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
// Nuxt config file
|
|
70
|
+
import { defineNuxtConfig } from 'nuxt/config'
|
|
71
|
+
|
|
72
|
+
export default defineNuxtConfig({
|
|
73
|
+
modules: [
|
|
74
|
+
'vuetify-nuxt-module'
|
|
75
|
+
],
|
|
76
|
+
vuetify: {
|
|
77
|
+
moduleOptions: {
|
|
78
|
+
/* module specific options */
|
|
79
|
+
},
|
|
80
|
+
vuetifyOptions: {
|
|
81
|
+
/* vuetify options */
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
})
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## 🔥 Components, Directives, Lab Components
|
|
88
|
+
|
|
89
|
+
The module will enable automatic tree shaking for Vuetify components.
|
|
90
|
+
|
|
91
|
+
You don't need to install any Vuetify Vite Plugin (the module will throw an error if any Vuetify Vite Plugin is installed in your Nuxt configuration):
|
|
92
|
+
- the module will provide auto-import support via `vuetify/dist/json/importMap.json` json file and Nuxt `components:extend` hook.
|
|
93
|
+
- the module will register a custom Vite Plugin for Vuetify styles: it is just a copy from the original Vuetify Vite Styles Plugin, changing some virtual names mappings and handling SSR flags.
|
|
94
|
+
|
|
95
|
+
### Global Components
|
|
96
|
+
|
|
97
|
+
If you need to add some global component, use `vuetifyOptions.components` module option, it has been declared properly to have better DX.
|
|
98
|
+
|
|
99
|
+
Check the [components definition](https://github.com/userquin/vuetify-nuxt-module/blob/main/src/types.ts#L80-L81).
|
|
100
|
+
|
|
101
|
+
You can also provide [Aliasing & Virtual Components](https://vuetifyjs.com/en/features/aliasing/#virtual-component-defaults) via `vuetifyOptions.aliases` module option to register components with a different name, only available for global components. The components require to be registered globally.
|
|
102
|
+
|
|
103
|
+
### Directives
|
|
104
|
+
|
|
105
|
+
By default, the module will not register any Vuetify directive. If you need to register some directive, use `vuetifyOptions.directives` module option, it has been declared properly to have better DX.
|
|
106
|
+
|
|
107
|
+
You can register all the directives or only the ones you need: check the [directives definition](https://github.com/userquin/vuetify-nuxt-module/blob/main/src/types.ts#L82-L83).
|
|
108
|
+
|
|
109
|
+
### Labs Components
|
|
110
|
+
|
|
111
|
+
The module provides support to use Vuetify [labs components](https://vuetifyjs.com/en/labs/introduction/) via `vuetifyOptions.labsComponents` module option, it has been declared properly to have better DX.
|
|
112
|
+
|
|
113
|
+
You can register all the labs components or only the ones you need: check the [labsComponent definition](https://github.com/userquin/vuetify-nuxt-module/blob/main/src/types.ts#L84-L85).
|
|
114
|
+
|
|
115
|
+
## 😃 Font Icons
|
|
116
|
+
|
|
117
|
+
This module supports the following font icons libraries:
|
|
118
|
+
- [Material Design Icons](https://materialdesignicons.com/)
|
|
119
|
+
- [Material Icons](https://fonts.google.com/icons)
|
|
120
|
+
- [Font Awesome 4](https://fontawesome.com/v4.7.0/)
|
|
121
|
+
- [Font Awesome 5](https://fontawesome.com/)
|
|
122
|
+
|
|
123
|
+
By default, the module will use the `mdi` font icon library. You can change it by setting the `defaultSet` option to:
|
|
124
|
+
- `mdi` for [Material Design Icons](https://materialdesignicons.com/)
|
|
125
|
+
- `md` for [Material Icons](https://fonts.google.com/icons)
|
|
126
|
+
- `fa4` for [Font Awesome 4](https://fontawesome.com/v4.7.0/)
|
|
127
|
+
- `fa` for [Font Awesome 5](https://fontawesome.com)
|
|
128
|
+
|
|
129
|
+
To configure a font icon you only need to specify the default set:
|
|
130
|
+
```ts
|
|
131
|
+
// Nuxt config file
|
|
132
|
+
import { defineNuxtConfig } from 'nuxt/config'
|
|
133
|
+
|
|
134
|
+
export default defineNuxtConfig({
|
|
135
|
+
modules: [
|
|
136
|
+
'vuetify-nuxt-module'
|
|
137
|
+
],
|
|
138
|
+
vuetify: {
|
|
139
|
+
vuetifyOptions: {
|
|
140
|
+
icons: {
|
|
141
|
+
defaultSet: 'mdi'
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
})
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
The module will use the CDN version of the font icon. If you want to use the local version, you only need to install the corresponding dependency, the module will auto-detect it and will switch to register the font to use the local version.
|
|
149
|
+
|
|
150
|
+
The CDN used for each font icon library, you can use the `cdn` option to change it:
|
|
151
|
+
- [CDN for Material Design Icons (mdi)](https://cdn.jsdelivr.net/npm/@mdi/font@5.x/css/materialdesignicons.min.css)
|
|
152
|
+
- [CDN for Material Icons (md)](https://fonts.googleapis.com/css?family=Material+Icons)
|
|
153
|
+
- [CDN for Font Awesome 4 (fa4)](https://cdn.jsdelivr.net/npm/font-awesome@4.x/css/font-awesome.min.css)
|
|
154
|
+
- [CDN for Font Awesome 5 (fa)](https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@latest/css/all.min.css)
|
|
155
|
+
|
|
156
|
+
To change the CDN for a font icon library you only need to specify the `cdn` option:
|
|
157
|
+
```ts
|
|
158
|
+
// Nuxt config file
|
|
159
|
+
import { defineNuxtConfig } from 'nuxt/config'
|
|
160
|
+
|
|
161
|
+
export default defineNuxtConfig({
|
|
162
|
+
modules: [
|
|
163
|
+
'vuetify-nuxt-module'
|
|
164
|
+
],
|
|
165
|
+
vuetify: {
|
|
166
|
+
vuetifyOptions: {
|
|
167
|
+
icons: {
|
|
168
|
+
defaultSet: 'mdi',
|
|
169
|
+
sets: [{
|
|
170
|
+
name: 'mdi',
|
|
171
|
+
cdn: 'https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons'
|
|
172
|
+
}]
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
})
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
## 🎭 SVG Icons
|
|
180
|
+
|
|
181
|
+
This module supports the following SVG icon libraries:
|
|
182
|
+
- [@mdi/js](https://www.npmjs.com/package/@mdi/js)
|
|
183
|
+
- [@fortawesome/fontawesome-svg-core](https://www.npmjs.com/package/@fortawesome/fontawesome-svg-core)
|
|
184
|
+
|
|
185
|
+
We're trying to figure out how to include the following SVG icon libraries:
|
|
186
|
+
- [Nuxt Icon](https://github.com/nuxt-modules/icon)
|
|
187
|
+
- [unplugin-icons](https://github.com/antfu/unplugin-icons)
|
|
188
|
+
|
|
189
|
+
### mdi-svg
|
|
190
|
+
|
|
191
|
+
You only need to add `@mdi/js` dependency to your project and configure the default set:
|
|
192
|
+
```ts
|
|
193
|
+
// Nuxt config file
|
|
194
|
+
import { defineNuxtConfig } from 'nuxt/config'
|
|
195
|
+
|
|
196
|
+
export default defineNuxtConfig({
|
|
197
|
+
modules: [
|
|
198
|
+
'vuetify-nuxt-module'
|
|
199
|
+
],
|
|
200
|
+
vuetify: {
|
|
201
|
+
vuetifyOptions: {
|
|
202
|
+
icons: {
|
|
203
|
+
defaultSet: 'mdi-svg'
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
})
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
You can also add icon aliases:
|
|
211
|
+
```ts
|
|
212
|
+
// Nuxt config file
|
|
213
|
+
import { defineNuxtConfig } from 'nuxt/config'
|
|
214
|
+
|
|
215
|
+
export default defineNuxtConfig({
|
|
216
|
+
modules: [
|
|
217
|
+
'vuetify-nuxt-module'
|
|
218
|
+
],
|
|
219
|
+
vuetify: {
|
|
220
|
+
vuetifyOptions: {
|
|
221
|
+
icons: {
|
|
222
|
+
defaultSet: 'mdi-svg',
|
|
223
|
+
svg: {
|
|
224
|
+
mdi: {
|
|
225
|
+
aliases: {
|
|
226
|
+
account: 'mdiAccount'
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
})
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### fa-svg
|
|
237
|
+
|
|
238
|
+
You only need to add `@fortawesome/fontawesome-svg-core`, `@fortawesome/vue-fontawesome` and `@fortawesome/free-solid-svg-icons` dependencies to your project and configure the default set:
|
|
239
|
+
```ts
|
|
240
|
+
// Nuxt config file
|
|
241
|
+
import { defineNuxtConfig } from 'nuxt/config'
|
|
242
|
+
|
|
243
|
+
export default defineNuxtConfig({
|
|
244
|
+
modules: [
|
|
245
|
+
'vuetify-nuxt-module'
|
|
246
|
+
],
|
|
247
|
+
vuetify: {
|
|
248
|
+
vuetifyOptions: {
|
|
249
|
+
icons: {
|
|
250
|
+
defaultSet: 'fa-svg'
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
})
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
You can also add more libraries and install them in your project, the module will register them for you (this is the default configuration using the above configuration):
|
|
258
|
+
```ts
|
|
259
|
+
// Nuxt config file
|
|
260
|
+
import { defineNuxtConfig } from 'nuxt/config'
|
|
261
|
+
|
|
262
|
+
export default defineNuxtConfig({
|
|
263
|
+
modules: [
|
|
264
|
+
'vuetify-nuxt-module'
|
|
265
|
+
],
|
|
266
|
+
vuetify: {
|
|
267
|
+
vuetifyOptions: {
|
|
268
|
+
icons: {
|
|
269
|
+
defaultSet: 'fa-svg',
|
|
270
|
+
svg: {
|
|
271
|
+
fa: {
|
|
272
|
+
libraries: [
|
|
273
|
+
[/* default export? */ false, /* export name */ 'fas', /* library */ '@fortawesome/free-solid-svg-icons']
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
})
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## 📦 Multiple Icon Sets
|
|
284
|
+
|
|
285
|
+
You can register multiple icons sets adding them to the sets array, don't forget to add the default set, otherwise 'mdi' will be used:
|
|
286
|
+
```ts
|
|
287
|
+
// Nuxt config file
|
|
288
|
+
import { defineNuxtConfig } from 'nuxt/config'
|
|
289
|
+
|
|
290
|
+
export default defineNuxtConfig({
|
|
291
|
+
modules: [
|
|
292
|
+
'vuetify-nuxt-module'
|
|
293
|
+
],
|
|
294
|
+
vuetify: {
|
|
295
|
+
vuetifyOptions: {
|
|
296
|
+
icons: {
|
|
297
|
+
defaultSet: 'mdi',
|
|
298
|
+
sets: ['mdi', 'fa']
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
})
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
## 🌍 I18n support
|
|
306
|
+
|
|
307
|
+
> Requires latest [@nuxtjs/i18n](https://v8.i18n.nuxtjs.org/) Nuxt module: `8.0.0.beta.13`.
|
|
308
|
+
|
|
309
|
+
You can check the playground folder, you can run it using single or multiple json files per locale:
|
|
310
|
+
- for single file per locale: run from root folder `pnpm install && nr dev:prepare && nr dev`
|
|
311
|
+
- for multiple files per locale: run from root folder `pnpm install && nr dev:prepare:multiple-json && nr dev:multiple-json`
|
|
312
|
+
|
|
313
|
+
## 📆 Date components support
|
|
314
|
+
|
|
315
|
+
Right now you can only use Vuetify adapter, there is a bug and will not work, I'm working on it: https://github.com/userquin/vuetify-nuxt-module/pull/9#issuecomment-1620023814.
|
|
316
|
+
|
|
317
|
+
To use Vuetify components [that require date functionality](https://vuetifyjs.com/en/features/dates/):
|
|
318
|
+
- install one of the [@date-io](https://github.com/dmtrKovalenko/date-io#projects) adapters (optional)
|
|
319
|
+
- configure the date entry in your Vuetify configuration:
|
|
320
|
+
```ts
|
|
321
|
+
vuetifyOptions: {
|
|
322
|
+
date: {
|
|
323
|
+
adapter: 'vuetify' // 'vuetify' | 'date-fns' | 'moment' | 'luxon' | 'dayjs' | 'js-joda' | 'date-fns-jalali' | 'jalaali' | 'hijri' | 'custom'
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
If you also have `@nuxtjs/i18n` module installed, `vuetifyOptions.date.locale` will be automatically configured, beware, the configured `locale` entry will be ignored.
|
|
329
|
+
|
|
330
|
+
If you want to use a custom date adapter, you can configure it using `vuetifyOptions.date.adapter = 'custom'`, and then:
|
|
331
|
+
- add a Nuxt Plugin and add the `vuetify:configuration` hook to configure your Vuetify options
|
|
332
|
+
- you can import the `virtual:vuetify-date-configuration` module, you will have access to the configuration:
|
|
333
|
+
```ts
|
|
334
|
+
import { adapter, dateConfiguration, i18n } from 'virtual:vuetify-date-configuration'
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
Check out [vuetify-date](https://github.com/userquin/vuetify-nuxt-module/blob/main/src/runtime/plugins/vuetify-date.mts) plugin for an example of a custom date adapter and how to access to the configuration.
|
|
338
|
+
|
|
339
|
+
## ⚙️ Auto-Import Vuetify Composables
|
|
340
|
+
|
|
341
|
+
No more Vuetify composables manual imports, auto import is enabled by default:
|
|
342
|
+
- [useDate](https://vuetifyjs.com/en/api/use-date/)
|
|
343
|
+
- [useDefaults](https://vuetifyjs.com/en/api/use-defaults/)
|
|
344
|
+
- [useDisplay](https://vuetifyjs.com/en/api/use-display/)
|
|
345
|
+
- [useLayout](https://vuetifyjs.com/en/api/use-layout/)
|
|
346
|
+
- [useLocale](https://vuetifyjs.com/en/api/use-locale/)
|
|
347
|
+
- [useRtl](https://vuetifyjs.com/en/api/use-rtl/)
|
|
348
|
+
- [useTheme](https://vuetifyjs.com/en/api/use-theme/)
|
|
349
|
+
|
|
350
|
+
You can disable auto-import using `moduleOptions.importComposables: false`.
|
|
351
|
+
|
|
352
|
+
If you are using another composables that collide with the Vuetify ones, enable `moduleOptions.prefixComposables: true` to prefix them with `V`:
|
|
353
|
+
- `useLocale` => `useVLocale`
|
|
354
|
+
- `useDefaults` => `useVDefaults`
|
|
355
|
+
- `useDisplay` => `useVDisplay`
|
|
356
|
+
- `useLayout` => `useVLayout`
|
|
357
|
+
- `useRtl` => `useVRtl`
|
|
358
|
+
- `useTheme` => `useVTheme`
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
## 🎨 Vuetify Blueprints
|
|
362
|
+
|
|
363
|
+
The module supports Vuetify Blueprints, just add it to the `vuetifyOptions.blueprint` module option, but with some limitations:
|
|
364
|
+
- `ssr` will be ignored, this flag can be only configured internally by the module via the Nuxt ssr option.
|
|
365
|
+
- `components` will be ignored, configure them using the `vuetifyOptions.components` module option
|
|
366
|
+
- `directives` will be ignored, configure them using the `vuetifyOptions.directives` module option.
|
|
367
|
+
- `locale` will be ignored, configure it using the `vuetifyOptions.locale` module option.
|
|
368
|
+
- `date` will be ignored, configure it using the `vuetifyOptions.date` module option.
|
|
369
|
+
- `icons` will be ignored, configure it using the `vuetifyOptions.icons` module option.
|
|
370
|
+
|
|
371
|
+
## 👀 Full config
|
|
372
|
+
|
|
373
|
+
Check out the type declaration [src/types.ts](https://github.com/userquin/vuetify-nuxt-module/blob/main/src/types.ts).
|
|
374
|
+
|
|
375
|
+
The virtual modules can be found in [configuration.d.ts](https://github.com/userquin/vuetify-nuxt-module/blob/main/configuration.d.ts) file.
|
|
376
|
+
|
|
377
|
+
## 📄 License
|
|
378
|
+
|
|
379
|
+
[MIT](https://github.com/userquin/vuetify-nuxt-module/blob/main/LICENSE) License © 2023-PRESENT [Joaquín Sánchez](https://github.com/userquin)
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { resolveVuetifyBase, normalizePath, writeStyles, cacheDir } from '@vueti
|
|
|
6
6
|
import { isAbsolute, join, relative } from 'pathe';
|
|
7
7
|
import { normalizePath as normalizePath$1 } from 'vite';
|
|
8
8
|
|
|
9
|
-
const version = "0.4.
|
|
9
|
+
const version = "0.4.2";
|
|
10
10
|
|
|
11
11
|
function isSubdir(root, test) {
|
|
12
12
|
const relative$1 = relative(root, test);
|
|
@@ -608,8 +608,6 @@ const module = defineNuxtModule({
|
|
|
608
608
|
dateAdapter = date[0];
|
|
609
609
|
}
|
|
610
610
|
}
|
|
611
|
-
const runtimeDir = resolver.resolve("./runtime");
|
|
612
|
-
nuxt.options.build.transpile.push(runtimeDir);
|
|
613
611
|
nuxt.options.build.transpile.push(CONFIG_KEY);
|
|
614
612
|
const icons = prepareIcons(logger, vuetifyOptions);
|
|
615
613
|
(_a = nuxt.options).css ?? (_a.css = []);
|
|
@@ -696,20 +694,21 @@ const module = defineNuxtModule({
|
|
|
696
694
|
));
|
|
697
695
|
}
|
|
698
696
|
});
|
|
697
|
+
const runtimeDir = resolver.resolve("./runtime");
|
|
699
698
|
addPlugin({
|
|
700
|
-
src: resolver.resolve(runtimeDir, "plugins/vuetify.
|
|
699
|
+
src: resolver.resolve(runtimeDir, "plugins/vuetify.ts")
|
|
701
700
|
});
|
|
702
701
|
addPlugin({
|
|
703
|
-
src: resolver.resolve(runtimeDir, "plugins/vuetify-icons.
|
|
702
|
+
src: resolver.resolve(runtimeDir, "plugins/vuetify-icons.ts")
|
|
704
703
|
});
|
|
705
704
|
if (i18n) {
|
|
706
705
|
addPlugin({
|
|
707
|
-
src: resolver.resolve(runtimeDir, "plugins/vuetify-i18n.
|
|
706
|
+
src: resolver.resolve(runtimeDir, "plugins/vuetify-i18n.ts")
|
|
708
707
|
});
|
|
709
708
|
}
|
|
710
709
|
if (dateAdapter) {
|
|
711
710
|
addPlugin({
|
|
712
|
-
src: resolver.resolve(runtimeDir, "plugins/vuetify-date.
|
|
711
|
+
src: resolver.resolve(runtimeDir, "plugins/vuetify-date.ts")
|
|
713
712
|
});
|
|
714
713
|
}
|
|
715
714
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { configureVuetify } from "./config.mjs";
|
|
2
|
+
import { defineNuxtPlugin } from "#imports";
|
|
3
|
+
import { useNuxtApp } from "#app";
|
|
4
|
+
export default defineNuxtPlugin({
|
|
5
|
+
name: "vuetify:configuration:plugin",
|
|
6
|
+
enforce: "post",
|
|
7
|
+
parallel: false,
|
|
8
|
+
setup() {
|
|
9
|
+
useNuxtApp().hook("app:created", configureVuetify);
|
|
10
|
+
}
|
|
11
|
+
});
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vuetify-nuxt-module",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.4.
|
|
5
|
-
"packageManager": "pnpm@8.6.
|
|
4
|
+
"version": "0.4.2",
|
|
5
|
+
"packageManager": "pnpm@8.6.7",
|
|
6
6
|
"description": "Zero-Config Nuxt Module for Vuetify ",
|
|
7
7
|
"author": "userquin <userquin@gmail.com>",
|
|
8
8
|
"license": "MIT",
|
|
@@ -114,4 +114,4 @@
|
|
|
114
114
|
"installDependencies": false,
|
|
115
115
|
"startCommand": "node .stackblitz.js && pnpm install && pnpm run dev"
|
|
116
116
|
}
|
|
117
|
-
}
|
|
117
|
+
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { configureVuetify } from './config'
|
|
2
|
-
import { defineNuxtPlugin } from '#imports'
|
|
3
|
-
import { useNuxtApp } from '#app'
|
|
4
|
-
|
|
5
|
-
export default defineNuxtPlugin({
|
|
6
|
-
name: 'vuetify:configuration:plugin',
|
|
7
|
-
enforce: 'pre',
|
|
8
|
-
setup() {
|
|
9
|
-
useNuxtApp().hook('app:created', configureVuetify)
|
|
10
|
-
},
|
|
11
|
-
})
|