jarvelov/vue-form-json-schema

Why don't checkboxes work?

unbywyd opened this issue · 0 comments

I can't get the checkboxes to work, what am I doing wrong?

Model

model: {
    checkbox: true,
}

uiSchema

uiSchema: [
  {
    component: "div",
    fieldOptions: {
      class: ["form-group"],
    },
    children: [
      {
        component: "div",
        children: [
          {
            component: "input",
            model: "checkbox",
            valueProp: "checked",
            fieldOptions: {
              on: ["change"],
              attrs: {
                name: "checkbox",
                type: "checkbox",
              },
            },
          },
        ],
      },
    ],
  },
],

Schema

   schema: {
        type: "object",
        required: ["checkbox"],
        properties: {
          checkbox: {
            type: "boolean",
          },
        },
   }

Example

  1. Checkbox not responding to model
  2. onChangeState not working when i interact with checkbox

What is the problem? ...