Skip to content

Commit 1b5bbc3

Browse files
committed
feat: vueform astro vueform js
1 parent 5af6195 commit 1b5bbc3

File tree

8 files changed

+96
-0
lines changed

8 files changed

+96
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineConfig } from 'astro/config'
2+
import vue from '@astrojs/vue'
3+
4+
// https://astro.build/config
5+
export default defineConfig({
6+
integrations: [vue({ appEntrypoint: '/src/pages/_app' })],
7+
})
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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
import Layout from '../layouts/Layout.astro';
3+
import TestForm from './../components/TestForm.vue';
4+
---
5+
<style is:global lang="scss">
6+
@import './../styles/style.scss';
7+
</style>
8+
9+
<Layout title="Welcome to Astro.">
10+
<TestForm client:only="vue" />
11+
</Layout>
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
@import '@vueform/vueform/themes/vueform/scss/index.scss';
2+
3+
@media (prefers-color-scheme: dark) {
4+
:root, :before, :after, * {
5+
@include vf-dark-vars;
6+
}
7+
}
8+
9+
:root {
10+
color: white;
11+
12+
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
13+
font-synthesis: none;
14+
text-rendering: optimizeLegibility;
15+
-webkit-font-smoothing: antialiased;
16+
-moz-osx-font-smoothing: grayscale;
17+
}
18+
19+
body {
20+
margin: 0;
21+
display: flex;
22+
place-items: center;
23+
min-width: 320px;
24+
min-height: 100vh;
25+
}
26+
27+
form {
28+
max-width: 1280px;
29+
margin: 0 auto;
30+
padding: 2rem;
31+
text-align: center;
32+
}
33+
34+
@media (prefers-color-scheme: light) {
35+
:root {
36+
color: black;
37+
}
38+
39+
html {
40+
background: white;
41+
}
42+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "astro/tsconfigs/base",
3+
"compilerOptions": {
4+
"jsx": "preserve"
5+
}
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import en from '@vueform/vueform/locales/en'
2+
import theme from '@vueform/vueform/dist/vueform'
3+
import { defineConfig } from '@vueform/vueform'
4+
5+
export default defineConfig({
6+
theme,
7+
locales: { en },
8+
locale: 'en',
9+
})

src/test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ async function main() {
141141
const isBuilder = builder === 'builder'
142142
const isTailwind = ['tailwind', 'tailwind-material'].indexOf(theme) !== -1
143143
const isBootstrap = ['bootstrap'].indexOf(theme) !== -1
144+
const isAstro = framework === 'astro'
144145

145146
/**
146147
* Enter project folder
@@ -173,6 +174,14 @@ async function main() {
173174
await runCommand('npm', ['install', 'bootstrap'])
174175
}
175176

177+
/**
178+
* Install Vue in Astro
179+
*/
180+
if (isAstro) {
181+
console.log('Installing Vue...')
182+
await runCommand('npm', ['install', 'vue', '@astrojs/vue'])
183+
}
184+
176185
/**
177186
* Install Vueform package
178187
*/

0 commit comments

Comments
 (0)