How to use the simpl-schema.default.oneOf function in simpl-schema

To help you get started, we’ve selected a few simpl-schema examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github steedos / object-server / schemas / object_fields.js View on Github external
label: '小数位数',
        optional: true,
        defaultValue: 2
    },
    reference_to: {
        type: String,
        label: '引用对象',
        optional: true
    },
    rows: {
        type: Number,
        label: '多行文本行数',
        optional: true
    },
    options: {
        type: SimpleSchema.oneOf(String, Array),
        label: '选择项',
        optional: true
    },
    'options.$': {
        type: Object,
        label: '',
        optional: true
    },
    'options.$.label': {
        type: String,
        label: '显示名称',
        optional: true
    },
    'options.$.value': {
        type: String,
        label: '值',
github steedos / object-server / schemas / object_fields.js View on Github external
optional: true,
        allowedValues: ['text', 'textarea', 'html', 'select', 'boolean', 'date', 'datetime', 'number', 'currency', 'password', 'lookup', 'master_detail', 'grid', 'url', 'email']
    },
    sort_no: {
        type: Number,
        label: '排序号',
        optional: true,
        defaultValue: 100
    },
    group: {
        type: String,
        label: '字段分组',
        optional: true
    },
    defaultValue: {
        type: SimpleSchema.oneOf(String, Boolean, Number, Function),
        label: '默认值',
        optional: true
    },
    allowedValues: {
        type: Array,
        label: '允许的值',
        optional: true
    },
    'allowedValues.$': String,
    multiple: {
        type: Boolean,
        label: '多选',
        optional: true
    },
    required: {
        type: Boolean,