fix(widget-select): allow number value type (#4599)

This commit is contained in:
Pearce 2020-11-18 08:26:31 -08:00 committed by GitHub
parent 33383af704
commit 9741a79e49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -143,6 +143,13 @@ collections: # A list of collections the CMS should be able to edit
options: ['a', 'b', 'c'], options: ['a', 'b', 'c'],
multiple: true, multiple: true,
} }
- {
label: 'Select numeric',
name: 'select_numeric',
widget: 'select',
options:
[{ label: 'One', value: 1 }, { label: 'Two', value: 2 }, { label: 'Three', value: 3 }],
}
- { label: 'Hidden', name: 'hidden', widget: 'hidden', default: 'hidden' } - { label: 'Hidden', name: 'hidden', widget: 'hidden', default: 'hidden' }
- label: 'Object' - label: 'Object'
name: 'object' name: 'object'

View File

@ -8,11 +8,12 @@ export default {
items: { items: {
oneOf: [ oneOf: [
{ type: 'string' }, { type: 'string' },
{ type: 'number' },
{ {
type: 'object', type: 'object',
properties: { properties: {
label: { type: 'string' }, label: { type: 'string' },
value: { type: 'string' }, value: { oneOf: [{ type: 'string' }, { type: 'number' }] },
}, },
required: ['label', 'value'], required: ['label', 'value'],
}, },