Skip to content

[FormItem] 如何自定义required的内容 #4115

Closed Answered by shiwofeiwo
shiwofeiwo asked this question in Q&A [2.x]
Discussion options

You must be logged in to vote
import React from 'react'
import {FormButtonGroup, FormItem, Input, Submit} from '@formily/next'
import {createForm} from '@formily/core'
import {createSchemaField, FormProvider} from '@formily/react'

const SchemaField = createSchemaField({
    components: {
        Input,
        FormItem,
    },
})

const form = createForm()

const schema = {
    type: 'object',
    properties: {
        input: {
            type: 'string',
            title: 'Datasource ID',
            'x-decorator': 'FormItem',
            'x-component': 'Input',
            'x-validator': {
                required: true,
                message: 'Required value'
            }
        },
    },
}


function App() {

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by shiwofeiwo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant