0

我正在使用 react json 模式表单,我是新手。当我遇到这种情况时,我在创建 Schema 和 UISchema 时遇到了问题。我有一个布尔问题。根据选择的选项(默认情况下显示是和否)我想显示另一个问题列表。

const schema = {
    question1: {
      title: 'Question 1 ',
      type: 'boolean',
    },
    answerYes: { 
       type: 'string',
       title: 'Answer Yes',
       description: 'Using const',
       oneOf: [
        {
         const: '1',
         title: 'Response of answer 1',
        },
        {
         const: '2',
         title: 'Response of answer 2',
        }]
    }
},

const UISchema = {
   question1: {
     'ui:widget': 'radio',
   },
   answerYes: {
     'ui:widget': 'radio',
   },
},

我怎样才能根据所选值隐藏/显示?

4

0 回答 0