1
1
[ ![ NPM Version] ( https://img.shields.io/npm/v/vue-form-json.svg )] ( https://www.npmjs.com/package/vue-form-json )
2
- [ ![ Build Status] ( https://travis-ci.org /14nrv/vue-form-json.svg?branch=dev )] ( https://travis-ci.org /14nrv/vue-form-json )
2
+ [ ![ Build Status] ( https://travis-ci.com /14nrv/vue-form-json.svg?branch=dev )] ( https://travis-ci.com /14nrv/vue-form-json )
3
3
[ ![ Test Coverage] ( https://api.codeclimate.com/v1/badges/af5a15db118dac6343ab/test_coverage )] ( https://codeclimate.com/github/14nrv/vue-form-json/test_coverage )
4
4
[ ![ Maintainability] ( https://api.codeclimate.com/v1/badges/af5a15db118dac6343ab/maintainability )] ( https://codeclimate.com/github/14nrv/vue-form-json/maintainability )
5
5
[ ![ semantic-release] ( https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg )] ( https://github.com/semantic-release/semantic-release )
@@ -38,11 +38,15 @@ Once submitted, an event 'formSubmitted' is emitted on $root with the formName a
38
38
label: ' the label'
39
39
}]
40
40
```
41
- - [x] Scoped slot everywhere inside form
41
+ - [x] Scoped slot everywhere inside the form
42
42
``` js
43
43
const formFields = [{ slot: ' nameOfTheSlot' , props: { foo: ' bar' } }]
44
44
```
45
- - [x] Html directly inside json (formFields props)
45
+ - [x] Custom fields support inside scoped slot
46
+ ``` html
47
+ <template #nameOfTheSlot =" { foo, updateFormValues, isFormReseted }" >
48
+ ```
49
+ - [x] Html support
46
50
``` js
47
51
const formFields = [{ html: ' <p>Your html content</p>' }]
48
52
```
@@ -83,6 +87,10 @@ Object.keys(rules).forEach(rule => {
83
87
</template >
84
88
85
89
<script >
90
+ // import 'bulma/css/bulma.min.css'
91
+ // import '@fortawesome/fontawesome-free/css/all.min.css'
92
+ // import 'vue-form-json/dist/vue-form-json.css'
93
+
86
94
import formJson from ' vue-form-json'
87
95
import jsonFields from ' ./../assets/fields'
88
96
@@ -92,19 +100,13 @@ Object.keys(rules).forEach(rule => {
92
100
formJson
93
101
},
94
102
mounted () {
95
- this .$root .$on (' formSubmitted' , values => alert ( JSON . stringify (values) ))
103
+ this .$root .$on (' formSubmitted' , values => console . log (values))
96
104
},
97
105
computed: {
98
106
jsonFields : () => jsonFields
99
107
}
100
108
}
101
109
</script >
102
-
103
- <style lang =" stylus" >
104
- @require '../node_modules/bulma/css/bulma.min.css'
105
- @require '../node_modules/@fortawesome/fontawesome-free/css/all.min.css'
106
- @require '../node_modules/vue-form-json/dist/vue-form-json.css'
107
- </style>
108
110
```
109
111
110
112
## Props available on formJson component
0 commit comments