File tree 5 files changed +20
-16
lines changed
5 files changed +20
-16
lines changed Original file line number Diff line number Diff line change 4
4
[ ![ License] ( https://img.shields.io/npm/l/element-form-builder.svg )] ( https://www.npmjs.com/package/element-form-builder )
5
5
[ ![ Dependencies] ( https://img.shields.io/david/codetrial/element-form-builder.svg )] ( https://www.npmjs.com/package/element-form-builder )
6
6
7
- 使用 JSON 配置构建 element-ui 动态表单.
7
+ 使用 JSON 配置构建 element-ui 动态表单。
8
8
9
9
:cn : 简体中文 | [ :us : English] ( README.md )
10
10
Original file line number Diff line number Diff line change 1
1
/**
2
- * Element form-builder v1.0 .0
2
+ * element- form-builder v1.1 .0
3
3
* (c) 2019 Felix Yang
4
4
*/
5
5
var _extends = Object . assign || function ( target ) {
@@ -182,17 +182,17 @@ var FormBuilder = {
182
182
183
183
children = [ checkbox ] ;
184
184
} else if ( tag === 'el-radio' ) {
185
- var radios = ( detail . items || [ ] ) . map ( function ( rc ) {
186
- var rcDetail = _extends ( {
185
+ var radios = ( detail . items || [ ] ) . map ( function ( option ) {
186
+ option = _extends ( {
187
187
name : detail . name
188
- } , rc ) ;
188
+ } , option ) ;
189
189
return h ( tag , {
190
- attrs : _extends ( { } , rcDetail ) ,
190
+ attrs : _extends ( { } , option ) ,
191
191
props : _extends ( {
192
192
value : value
193
- } , rcDetail ) ,
193
+ } , option ) ,
194
194
on : _extends ( { } , modelEvents )
195
- } , [ rc . text ] ) ;
195
+ } , [ option . text ] ) ;
196
196
} ) ;
197
197
children = [ ] . concat ( toConsumableArray ( radios ) ) ;
198
198
} else {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " element-form-builder" ,
3
- "version" : " 1.0 .0" ,
3
+ "version" : " 1.1 .0" ,
4
4
"description" : " Build element-ui forms with JSON schema." ,
5
5
"main" : " dist/index.js" ,
6
+ "files" : [
7
+ " src" ,
8
+ " dist"
9
+ ],
6
10
"scripts" : {
7
11
"build" : " node scripts/build.js" ,
8
12
"test" : " yarn test"
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ const babel = require('rollup-plugin-babel')
2
2
const rollup = require ( 'rollup' )
3
3
const version = process . env . VERSION || require ( '../package.json' ) . version
4
4
const year = new Date ( ) . getFullYear ( )
5
- const banner = `/**\n * Element form-builder v${ version } \n * (c) ${ year } Felix Yang\n */`
5
+ const banner = `/**\n * element- form-builder v${ version } \n * (c) ${ year } Felix Yang\n */`
6
6
7
7
const inputOptions = {
8
8
input : 'src/index.js' ,
Original file line number Diff line number Diff line change @@ -176,26 +176,26 @@ export default {
176
176
177
177
children = [ checkbox ]
178
178
} else if ( tag === 'el-radio' ) {
179
- const radios = ( detail . items || [ ] ) . map ( rc => {
180
- const rcDetail = {
179
+ const radios = ( detail . items || [ ] ) . map ( option => {
180
+ option = {
181
181
name : detail . name ,
182
- ...rc
182
+ ...option
183
183
}
184
184
return h (
185
185
tag ,
186
186
{
187
187
attrs : {
188
- ...rcDetail
188
+ ...option
189
189
} ,
190
190
props : {
191
191
value,
192
- ...rcDetail
192
+ ...option
193
193
} ,
194
194
on : {
195
195
...modelEvents
196
196
}
197
197
} ,
198
- [ rc . text ]
198
+ [ option . text ]
199
199
)
200
200
} )
201
201
children = [ ...radios ]
You can’t perform that action at this time.
0 commit comments