Skip to content

Commit 7140b2f

Browse files
committed
feat: vueform templates for builder
1 parent 07f43ba commit 7140b2f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+358
-8
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineConfig } from '@vueform/builder'
22

3-
import '@vueform/builder/index.css'
3+
import '@vueform/builder/tailwind.css'
44

55
export default defineConfig({})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineConfig } from '@vueform/builder'
22

3-
import '@vueform/builder/index.css'
3+
import '@vueform/builder/tailwind.css'
44

55
export default defineConfig({})
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineConfig } from 'astro/config'
2+
import vue from '@astrojs/vue'
3+
4+
// https://astro.build/config
5+
export default defineConfig({
6+
integrations: [
7+
vue({ appEntrypoint: '/src/pages/_app' }),
8+
],
9+
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig } from '@vueform/builder'
2+
3+
import '@vueform/builder/vueform.css'
4+
5+
export default defineConfig({})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div style="height: 100vh;">
3+
<VueformBuilder />
4+
</div>
5+
</template>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
const builderConfig = (await import('../../builder.config')).default
7+
const Builder = (await import('@vueform/builder')).default
8+
app.use(Vueform, vueformConfig)
9+
app.use(Builder, builderConfig)
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
import Layout from '../layouts/Layout.astro';
3+
import FormBuilder from '../components/FormBuilder.vue';
4+
---
5+
<script is:inline type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBCToIMP1Rk6ZbGcfnJ2iwsnb09_lnxLmY&libraries=places"></script>
6+
7+
<Layout title="Welcome to Astro.">
8+
<FormBuilder client:only="vue"/>
9+
</Layout>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import en from '@vueform/vueform/locales/en'
2+
import theme from '@vueform/vueform/dist/vueform'
3+
import { defineConfig } from '@vueform/vueform'
4+
import builder from '@vueform/builder/plugin'
5+
6+
import '@vueform/vueform/dist/vueform.css'
7+
8+
export default defineConfig({
9+
theme,
10+
locales: { en },
11+
locale: 'en',
12+
apiKey: 'YOUR_PUBLIC_KEY',
13+
plugins: [
14+
builder,
15+
],
16+
})
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { defineConfig } from 'astro/config'
2+
import vue from '@astrojs/vue'
3+
4+
// https://astro.build/config
5+
export default defineConfig({
6+
integrations: [
7+
vue({ appEntrypoint: '/src/pages/_app' }),
8+
],
9+
})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig } from '@vueform/builder'
2+
3+
import '@vueform/builder/vueform.css'
4+
5+
export default defineConfig({})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div style="height: 100vh;">
3+
<VueformBuilder />
4+
</div>
5+
</template>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
const builderConfig = (await import('../../builder.config')).default
7+
const Builder = (await import('@vueform/builder')).default
8+
app.use(Vueform, vueformConfig)
9+
app.use(Builder, builderConfig)
10+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
import Layout from '../layouts/Layout.astro';
3+
import FormBuilder from '../components/FormBuilder.vue';
4+
---
5+
<script is:inline type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBCToIMP1Rk6ZbGcfnJ2iwsnb09_lnxLmY&libraries=places"></script>
6+
7+
<Layout title="Welcome to Astro.">
8+
<FormBuilder client:only="vue"/>
9+
</Layout>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import en from '@vueform/vueform/locales/en'
2+
import theme from '@vueform/vueform/dist/vueform'
3+
import { defineConfig } from '@vueform/vueform'
4+
import builder from '@vueform/builder/plugin'
5+
6+
import '@vueform/vueform/dist/vueform.css'
7+
8+
export default defineConfig({
9+
theme,
10+
locales: { en },
11+
locale: 'en',
12+
apiKey: 'YOUR_PUBLIC_KEY',
13+
plugins: [
14+
builder,
15+
],
16+
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineConfig } from '@vueform/builder'
22

3-
import '@vueform/builder/index.css';
3+
import '@vueform/builder/tailwind.css';
44

55
export default defineConfig({})

templates/builder/laravel/tailwind/js/vueform.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import en from '@vueform/vueform/locales/en'
2-
import vueform from '@vueform/vueform/dist/tailwind'
2+
import theme from '@vueform/vueform/dist/tailwind'
33
import { defineConfig } from '@vueform/vueform'
44
import builder from '@vueform/builder/plugin'
55

66
export default defineConfig({
7-
theme: vueform,
7+
theme,
88
locales: { en },
99
locale: 'en',
1010
axios: window.axios,
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig } from '@vueform/builder'
2+
3+
import '@vueform/builder/vueform.css';
4+
5+
export default defineConfig({})
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body {
2+
margin: 0;
3+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import './bootstrap'
2+
3+
import { createApp } from 'vue'
4+
import App from './components/App.vue'
5+
import Vueform from '@vueform/vueform'
6+
import vueformConfig from './../../vueform.config'
7+
import Builder from '@vueform/builder'
8+
import builderConfig from './../../builder.config'
9+
10+
const app = createApp(App)
11+
app.use(Vueform, vueformConfig)
12+
app.use(Builder, builderConfig)
13+
app.mount('#app')
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div style="height: 100vh;">
3+
<VueformBuilder />
4+
</div>
5+
</template>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>Laravel</title>
7+
@vite(['resources/css/app.css', 'resources/js/app.js'])
8+
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBCToIMP1Rk6ZbGcfnJ2iwsnb09_lnxLmY&libraries=places"></script>
9+
</head>
10+
<body>
11+
<div id="app"></div>
12+
</body>
13+
</html>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { defineConfig } from 'vite';
2+
import laravel from 'laravel-vite-plugin';
3+
import vue from '@vitejs/plugin-vue';
4+
5+
export default defineConfig({
6+
plugins: [
7+
laravel({
8+
input: [
9+
'resources/css/app.css',
10+
'resources/js/app.js',
11+
],
12+
refresh: true,
13+
}),
14+
vue({
15+
template: {
16+
transformAssetUrls: {
17+
// The Vue plugin will re-write asset URLs, when referenced
18+
// in Single File Components, to point to the Laravel web
19+
// server. Setting this to `null` allows the Laravel plugin
20+
// to instead re-write asset URLs to point to the Vite
21+
// server instead.
22+
base: null,
23+
24+
// The Vue plugin will parse absolute URLs and treat them
25+
// as absolute paths to files on disk. Setting this to
26+
// `false` will leave absolute URLs un-touched so they can
27+
// reference assets in the public directory as expected.
28+
includeAbsolute: false,
29+
},
30+
},
31+
}),
32+
],
33+
});
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import en from '@vueform/vueform/locales/en'
2+
import theme from '@vueform/vueform/dist/vueform'
3+
import { defineConfig } from '@vueform/vueform'
4+
import builder from '@vueform/builder/plugin'
5+
6+
import '@vueform/vueform/dist/vueform.css'
7+
8+
export default defineConfig({
9+
theme,
10+
locales: { en },
11+
locale: 'en',
12+
axios: window.axios,
13+
apiKey: 'YOUR_PUBLIC_KEY',
14+
plugins: [
15+
builder,
16+
],
17+
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineConfig } from '@vueform/builder'
22

3-
import '@vueform/builder/index.css'
3+
import '@vueform/builder/tailwind.css'
44

55
export default defineConfig({})
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<template>
2+
<div style="height: 100vh;">
3+
<ClientOnly>
4+
<VueformBuilder />
5+
</ClientOnly>
6+
</div>
7+
</template>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap');
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig } from '@vueform/builder'
2+
3+
import '@vueform/builder/vueform.css'
4+
5+
export default defineConfig({})
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// https://nuxt.com/docs/api/configuration/nuxt-config
2+
export default defineNuxtConfig({
3+
app: {
4+
head: {
5+
script: [
6+
{
7+
async: true,
8+
src: 'https://maps.googleapis.com/maps/api/js?key=AIzaSyBCToIMP1Rk6ZbGcfnJ2iwsnb09_lnxLmY&libraries=places',
9+
},
10+
],
11+
},
12+
},
13+
devtools: { enabled: true },
14+
css: ['~/assets/css/main.css'],
15+
modules: [
16+
'@vueform/builder-nuxt',
17+
],
18+
})
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import en from '@vueform/vueform/locales/en'
2+
import theme from '@vueform/vueform/dist/vueform'
3+
import { defineConfig } from '@vueform/vueform'
4+
import builder from '@vueform/builder/plugin'
5+
6+
import '@vueform/vueform/dist/vueform.css'
7+
8+
export default defineConfig({
9+
theme,
10+
locales: { en },
11+
locale: 'en',
12+
apiKey: 'YOUR_PUBLIC_KEY',
13+
plugins: [
14+
builder,
15+
],
16+
})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineConfig } from '@vueform/builder'
22

3-
import '@vueform/builder/index.css'
3+
import '@vueform/builder/tailwind.css'
44

55
export default defineConfig({})
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineConfig } from '@vueform/builder'
22

3-
import '@vueform/builder/index.css'
3+
import '@vueform/builder/tailwind.css'
44

55
export default defineConfig({})
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { defineConfig } from '@vueform/builder'
2+
3+
import '@vueform/builder/vueform.css'
4+
5+
export default defineConfig({})
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite + Vue</title>
8+
<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBCToIMP1Rk6ZbGcfnJ2iwsnb09_lnxLmY&libraries=places"></script>
9+
</head>
10+
<body>
11+
<div id="app"></div>
12+
<script type="module" src="/src/main.js"></script>
13+
</body>
14+
</html>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<template>
2+
<div style="height: 100vh">
3+
<VueformBuilder />
4+
</div>
5+
</template>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { createApp } from 'vue'
2+
import './style.css'
3+
import App from './App.vue'
4+
import Vueform from '@vueform/vueform'
5+
import vueformConfig from './../vueform.config'
6+
import Builder from '@vueform/builder'
7+
import builderConfig from './../builder.config'
8+
9+
const app = createApp(App)
10+
app.use(Vueform, vueformConfig)
11+
app.use(Builder, builderConfig)
12+
app.mount('#app')
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap');

0 commit comments

Comments
 (0)