Skip to content

Commit 3e7d744

Browse files
committed
feat: vueform astro tailwinds
1 parent 23f5959 commit 3e7d744

25 files changed

+252
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineConfig } from 'astro/config'
2+
import vue from '@astrojs/vue'
3+
import tailwind from '@astrojs/tailwind';
4+
5+
// https://astro.build/config
6+
export default defineConfig({
7+
integrations: [
8+
vue({ appEntrypoint: '/src/pages/_app' }),
9+
tailwind(),
10+
],
11+
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<Vueform>
3+
<TextElement name="hello_world" label="Hello" placeholder="World" />
4+
</Vueform>
5+
</template>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { App } from 'vue';
2+
import Vueform from '@vueform/vueform'
3+
4+
export default async (app: App) => {
5+
const vueformConfig = (await import('../../vueform.config')).default
6+
app.use(Vueform, vueformConfig)
7+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
import Layout from '../layouts/Layout.astro';
3+
import TestForm from './../components/TestForm.vue';
4+
---
5+
6+
<Layout title="Welcome to Astro.">
7+
<div class="dark max-w-[320px] h-screen flex items-center justify-center mx-auto">
8+
<TestForm client:only="vue" class="dark:text-white" />
9+
</div>
10+
</Layout>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import vueformPlugin from '@vueform/vueform/tailwind'
2+
3+
/** @type {import('tailwindcss').Config} */
4+
export default {
5+
content: [
6+
'./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}',
7+
'./vueform.config.js',
8+
'./node_modules/@vueform/vueform/themes/tailwind/**/*.vue',
9+
'./node_modules/@vueform/vueform/themes/tailwind/**/*.js',
10+
],
11+
darkMode: 'class',
12+
theme: {
13+
extend: {},
14+
},
15+
plugins: [
16+
vueformPlugin,
17+
],
18+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import en from '@vueform/vueform/locales/en'
2+
import theme from '@vueform/vueform/dist/tailwind-material'
3+
import { defineConfig } from '@vueform/vueform'
4+
5+
import '@vueform/vueform/dist/tailwind-material.css'
6+
7+
export default defineConfig({
8+
theme,
9+
locales: { en },
10+
locale: 'en',
11+
})
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineConfig } from 'astro/config'
2+
import vue from '@astrojs/vue'
3+
import tailwind from '@astrojs/tailwind';
4+
5+
// https://astro.build/config
6+
export default defineConfig({
7+
integrations: [
8+
vue({ appEntrypoint: '/src/pages/_app' }),
9+
tailwind(),
10+
],
11+
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<Vueform>
3+
<TextElement name="hello_world" label="Hello" placeholder="World" />
4+
</Vueform>
5+
</template>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { App } from 'vue';
2+
import Vueform from '@vueform/vueform'
3+
4+
export default async (app: App) => {
5+
const vueformConfig = (await import('../../vueform.config')).default
6+
app.use(Vueform, vueformConfig)
7+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
import Layout from '../layouts/Layout.astro';
3+
import TestForm from './../components/TestForm.vue';
4+
---
5+
6+
<Layout title="Welcome to Astro.">
7+
<div class="dark max-w-[320px] h-screen flex items-center justify-center mx-auto">
8+
<TestForm client:only="vue" class="dark:text-white" />
9+
</div>
10+
</Layout>

0 commit comments

Comments
 (0)