a conditional-logic-form that you can use in modern browsers. It's lightweight and requires no dependencies.
you can try it on online demo
import ConditionalLogic from 'ConditionalLogic';
const list = [
{
id: 1111,
label: '出行方式',
list: [
{
id: 1111,
label: 'trip mode',
},
{
id: 222,
label: 'flight',
},
],
conditionValue: 1,
},
{
id: 2222,
label: 'type',
list: [
{
id: 1111,
label: 'trip mode',
},
{
id: 222,
label: 'flight',
},
{
id: 33,
label: 'date',
},
],
conditionValue: 1,
},
];
const conditionalLogicForm = new ConditionalLogic('#form', { list });
and you can get the data from the form
const data = conditionalLogicForm.getData();
This project is licensed under the MIT License