You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`src/main.ts` is a playground for testing things and will work with the `dev` script which will serve a vite server in dev mode.
12
+
Everything can just be done from the config. Nuxt will automatically import the component types. The module also automatically registers it's tailwind config and provides the necessary colors to the tailwind theme viewer for use with `@nuxtjs/tailwindcss`, be sure to install it as a peer dependency.
13
13
14
-
`scr/main.lib.ts` is the actual library export which is used when vite builds in production mode.
14
+
```ts
15
+
modules: [
16
+
[
17
+
"@alanscodelog/vue-components/nuxt",
18
+
"@nuxtjs/tailwindcss",
19
+
],
20
+
],
21
+
vite: {
22
+
vue: {
23
+
script: {
24
+
defineModel: true,
25
+
},
26
+
}
27
+
}
15
28
29
+
```
16
30
17
-
##Usage with Vite
31
+
# Usage with Vite
18
32
19
33
In `main.ts` or where vue is mounted:
20
34
@@ -51,24 +65,46 @@ In the vite config, vue will require the experimental useModel:
51
65
}),
52
66
],
53
67
```
68
+
## Setting up Tailwind
54
69
55
-
<!-- TODO test -->
56
70
You should also be able to use tailwind directly instead of importing the styles.
57
71
58
-
The package provides a plugin `@alanscodelog/vue-components/tailwind/plugin.js` that can be used with tailwind. It should then be configured similar to the library's config.
72
+
You can use the exported config and merge it with your own if needed.
If you need to setup the config completely from scratch the package provides a plugin `@alanscodelog/vue-components/tailwind/plugin.js` that sets up a few utility classes. It also requires setting up the theming library. The options it uses are exported for easy re-use.
// you can also use your own metamorphosis theme so long as the necessary colors are provided ( warning/ok/danger/accent, neutral is also used, but that is already provided by tailwind )
0 commit comments