Skip to content

Commit 94ee21a

Browse files
committed
Merge branch 'hotfix/compatible-enum-without-options'
2 parents 81949f3 + e6d500e commit 94ee21a

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [2.3.2](https://github.com/chenquincy/vue-dynamic-form-component/compare/v2.3.1...v2.3.2) (2019-10-28)
6+
7+
8+
### Bug Fixes
9+
10+
* compatible enum type without descriptor.options ([5833ddf](https://github.com/chenquincy/vue-dynamic-form-component/commit/5833ddf))
11+
12+
13+
514
## [2.3.1](https://github.com/chenquincy/vue-dynamic-form-component/compare/v2.3.0...v2.3.1) (2019-09-23)
615

716

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-dynamic-form-component",
3-
"version": "2.3.1",
3+
"version": "2.3.2",
44
"license": "MIT",
55
"author": {
66
"email": "mail@quincychen.cn",

packages/dynamic-input/input.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,13 @@ export default {
7676
}
7777
},
7878
_options () {
79-
if (this.descriptor && this.descriptor.options instanceof Array) {
80-
return this.descriptor.options.map(item => {
81-
if (typeof item === 'string') {
82-
return { label: item, value: item }
83-
} else {
79+
if (this.descriptor.enum || this.descriptor.options) {
80+
const data = this.descriptor.options instanceof Array ? this.descriptor.options : this.descriptor.enum
81+
return data.map(item => {
82+
if (typeof item === 'object') {
8483
return item
84+
} else {
85+
return { label: item, value: item }
8586
}
8687
})
8788
} else {

0 commit comments

Comments
 (0)