Skip to content

Commit 10eea8a

Browse files
committed
Merge branch 'main' into 8-tests
# Conflicts: # yarn.lock
2 parents 2c6f083 + 76b0440 commit 10eea8a

File tree

3 files changed

+112
-166
lines changed

3 files changed

+112
-166
lines changed

README.md

Lines changed: 19 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +1,26 @@
11
# Vue 3 Form Generator
2-
A schema-based form generator component for Vue 3, based on `vue-form-generator`
2+
![GitHub last commit](https://img.shields.io/github/last-commit/kevinkosterr/vue3-form-generator?logo=github)
3+
![Static Badge](https://img.shields.io/badge/Vue%20version-3.x.x-green?logo=vue.js)
4+
![NPM Version](https://img.shields.io/npm/v/%40kevinkosterr%2Fvue3-form-generator?logo=npm)
5+
![GitHub License](https://img.shields.io/github/license/kevinkosterr/vue3-form-generator)
6+
<br>
7+
A schema-based form generator component for Vue 3, based on the original
8+
[`vue-form-generator`](https://github.com/vue-generators/vue-form-generator) library.
39

4-
## Basic usage
5-
1. Install plugin in your Vue app, this will make all necessary components globally available in your app.
6-
```javascript
7-
// ...
10+
You can find documentation on the [documentation page](https://kevinkosterr.github.io/vue3-form-generator-docs).
811

9-
import VueFormGenerator from '@kevinkosterr/vue3-form-generator'
10-
11-
app.use(VueFormGenerator)
12-
13-
// ...
12+
## Building for development
13+
1. Install the dependencies
14+
```bash
15+
yarn install
1416
```
15-
2. Define a schema inside your Vue component
16-
<br><br>
17-
#### Composition API:
18-
```vue
19-
<template>
20-
<vue-form-generator :schema="form.schema" :model="form.model"/>
21-
</template>
22-
23-
<script setup>
24-
import { ref } from 'vue'
25-
26-
const form = ref({
27-
model: {
28-
name: '',
29-
terms: false,
30-
},
31-
schema: {
32-
fields: [
33-
{
34-
name: 'name',
35-
label: 'Name',
36-
type: 'input',
37-
inputType: 'text',
38-
model: 'name',
39-
placeholder: "Write name...",
40-
readonly: false,
41-
required: true,
42-
},
43-
{
44-
name: 'terms',
45-
label: 'Accept terms and conditions',
46-
type: 'input',
47-
inputType: 'checkbox',
48-
model: 'terms',
49-
}
50-
]
51-
}
52-
})
53-
</script>
17+
2. Create a schema inside the playground folder, for this you can copy `schema.example.js`.
18+
```bash
19+
cp playground/schema.example.js playground/schema.js
5420
```
55-
#### Options API:
56-
```vue
57-
<template>
58-
<vue-form-generator :schema="form.schema" :model="form.model"/>
59-
</template>
60-
61-
<script>
62-
export default {
63-
data () {
64-
return {
65-
form: {
66-
model: {
67-
name: '',
68-
},
69-
schema: {
70-
fields: [
71-
{
72-
name: 'name',
73-
label: 'Name',
74-
type: 'input',
75-
inputType: 'text',
76-
model: 'name',
77-
placeholder: "Write name...",
78-
readonly: false,
79-
required: true,
80-
}
81-
]
82-
}
83-
}
84-
}
85-
}
86-
}
87-
</script>
21+
3. Run the development playground
22+
```bash
23+
yarn run dev
8824
```
8925

26+

package.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kevinkosterr/vue3-form-generator",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"private": false,
55
"type": "module",
66
"author": "Kevin Koster (@kevinkoster)",
@@ -24,6 +24,15 @@
2424
"files": [
2525
"dist"
2626
],
27+
"keywords": [
28+
"vue-form-generator",
29+
"form generator",
30+
"form",
31+
"schema",
32+
"vue3-form-generator",
33+
"vue3 forms",
34+
"vuejs"
35+
],
2736
"dependencies": {},
2837
"devDependencies": {
2938
"@stylistic/eslint-plugin": "^2.8.0",

0 commit comments

Comments
 (0)