1
1
![ Library Banner] ( https://res.cloudinary.com/alvarosaburido/image/upload/v1589993773/portfolio/web/vue-dynamic-forms/open-graph-preview_kv4glm.png )
2
2
3
- # Vue Dynamic Forms
3
+ # Vue ` 3.x.x ` Dynamic Forms
4
4
5
5
<p align =" center " >
6
6
<a href =" https://www.npmjs.com/package/@asigloo/vue-dynamic-forms " >
7
- <img src="https://badgen.net/npm/v/@asigloo/vue-dynamic-forms" alt="Current npm version">
7
+ <img src="https://badgen.net/npm/v/@asigloo/vue-dynamic-forms/next " alt="Current npm version">
8
8
</a >
9
- <a href =" https://bundlephobia.com/result?p=@asigloo/vue-dynamic-forms@0.2.0 " >
10
- <img src="https://flat.badgen.net/bundlephobia/min/@asigloo/vue-dynamic-forms" alt="Minified size">
9
+ <a href =" https://bundlephobia.com/result?p=@asigloo/vue-dynamic-forms@next " >
10
+ <img src="https://flat.badgen.net/bundlephobia/min/@asigloo/vue-dynamic-forms@next " alt="Minified size">
11
11
</a >
12
12
<a href =" https://vuejs.org " >
13
- <img src="https://flat.badgen.net/badge/vue.js/2.6 .x/4fc08d?icon=github" alt="Vue.js version">
13
+ <img src="https://flat.badgen.net/badge/vue.js/3.x .x/4fc08d?icon=github" alt="Vue.js version">
14
14
</a >
15
15
</p >
16
16
@@ -23,55 +23,49 @@ Especially if you need to create a very large form, in which the inputs are simi
23
23
24
24
So, wouldn't it be more economical to create the forms dynamically? Based on metadata that describes the business object model?
25
25
26
- That's Vue Dynamic Forms.
26
+ That's ** Vue Dynamic Forms** .
27
+
28
+ ## Status: Beta
29
+
30
+ This is the Vue ` 3.x.x ` compatible version. The focus right now is out of the box ` Typescript ` support, three shakeable, improve accesiility and be lighter in size. For Vue ` 2.x.x ` please use the library tags [ 0.x] ( https://github.com/alvarosaburido/vue-dynamic-forms/tree/0.x ) .
27
31
28
32
## Documentation
29
33
30
34
Complete documentation and examples available at
31
35
32
36
- ** [ Documentation] ( https://vue-dynamic-forms.netlify.app ) **
33
37
- ** [ Sandbox Demo] ( https://codesandbox.io/s/vue-dynamic-forms-ftzes ) **
38
+ - ** Migration Guide** (soon)
34
39
35
40
## Installation
36
41
37
42
``` bash
38
- $ npm install @asigloo/vue-dynamic-forms
43
+ $ npm install @asigloo/vue-dynamic-forms@next
39
44
```
40
45
41
46
or if you prefer yarn
42
47
43
48
``` bash
44
- $ yarn add @asigloo/vue-dynamic-forms
49
+ $ yarn add @asigloo/vue-dynamic-forms@next
45
50
```
46
51
47
52
## Usage
48
53
49
- ### Global
54
+ The installation and usage has change to align with new Vue 3 initialization process.
50
55
51
- Register the component globally in your ` main.js ` :
56
+ To create a new ` Dynamic Form ` instance, use the ` createDynamicForms ` function;
52
57
53
58
``` js
54
- import Vue from ' vue' ;
55
- import VueDynamicForms from ' @asigloo/vue-dynamic-forms' ;
56
-
57
- Vue .use (VueDynamicForms);
58
- ```
59
-
60
- ### Local
61
-
62
- You can include the dynamic form directly to your component.
59
+ import { createApp } from ' vue' ;
60
+ import { createDynamicForms } from ' @asigloo/vue-dynamic-forms' ;
63
61
64
- ``` js
65
- import Vue from ' vue ' ;
66
- import { DynamicForm } from ' @asigloo/vue-dynamic-forms ' ;
62
+ const VueDynamicForms = createDynamicForms ({
63
+ theme : ' material ' ,
64
+ }) ;
67
65
68
- const components = { DynamicForm } ;
66
+ export const app = createApp (App) ;
69
67
70
- export {
71
- ...
72
- components ,
73
- ...
74
- }
68
+ app .use (VueDynamicForms);
75
69
```
76
70
77
71
## Development
@@ -94,6 +88,12 @@ yarn run serve
94
88
yarn run build
95
89
```
96
90
91
+ ### Generate types
92
+
93
+ ```
94
+ yarn run build:dts
95
+ ```
96
+
97
97
### Run your tests
98
98
99
99
```
@@ -118,13 +118,7 @@ If you find this library useful and you want to help improve it, maintain it or
118
118
119
119
## Todolist
120
120
121
- This are the features I have planned for next versions of this library
122
-
123
- - [x] Material theme
124
- - [ ] Form Mixins for fields manipulation (for example, change values of a field depending of other)
125
- - [ ] More complex input types.
126
- - [x] Nuxt plugin istall
127
- - [x] Better docs & online examples
121
+ - [ ] Update docs
128
122
129
123
## License
130
124
0 commit comments