{"id":21121511,"url":"https://github.com/tggcs/schema-json-vue","last_synced_at":"2025-09-01T00:48:21.177Z","repository":{"id":37693035,"uuid":"181859077","full_name":"tggcs/schema-json-vue","owner":"tggcs","description":"a form builder based on jsonschema","archived":false,"fork":false,"pushed_at":"2022-12-10T17:13:13.000Z","size":3787,"stargazers_count":5,"open_issues_count":23,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-02T19:16:22.585Z","etag":null,"topics":["form-builder","json-schema","jsonschema","vue-jsonschema"],"latest_commit_sha":null,"homepage":"https://tggcs.github.io/projects/schema-json-vue/index.html","language":"Vue","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tggcs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-17T09:24:45.000Z","updated_at":"2024-12-17T06:08:57.000Z","dependencies_parsed_at":"2023-01-26T06:46:26.110Z","dependency_job_id":null,"html_url":"https://github.com/tggcs/schema-json-vue","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tggcs/schema-json-vue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tggcs%2Fschema-json-vue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tggcs%2Fschema-json-vue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tggcs%2Fschema-json-vue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tggcs%2Fschema-json-vue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tggcs","download_url":"https://codeload.github.com/tggcs/schema-json-vue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tggcs%2Fschema-json-vue/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264352897,"owners_count":23594989,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["form-builder","json-schema","jsonschema","vue-jsonschema"],"created_at":"2024-11-20T03:51:02.808Z","updated_at":"2025-07-08T21:32:46.316Z","avatar_url":"https://github.com/tggcs.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# schema-json-vue\n\n## 功能\n演示 https://tggcs.github.io/projects/schema-json-vue/index.html\n\n参考 https://mozilla-services.github.io/react-jsonschema-form/\n\n实现了一个vue2的版本，当前支持简单的功能。\n\n支持了五种输入控件：单行文本[默认]，多行文本[textarea]，单选[enum默认]，计数器[step]，开关[switch]\n\n支持了一种属性：必填[required]\n\n\n## 调用\n```shell\nnpm install schema-json-vue -S\n```\n因为使用了ElementUI组件，还需要安装下ElementUI\n\nmain.js\n``` javascript\nimport Vue from 'vue'\nimport 'element-ui/lib/theme-chalk/index.css';\nimport ElementUI from 'element-ui';\nimport 'schema-json-vue/dist/schema-json-vue.css';\nimport SchemaJsonVue from 'schema-json-vue'\n\nVue.use(ElementUI)\nVue.use(SchemaJsonVue)\n```\n***.vue\n``` javascript\n...\n\u003cschema-json-vue :schema=\"schema\" :json=\"json\" @onJsonChange=\"handleChange\"/\u003e\n...\ndata() {\n  return {\n    json: {},\n    schema: {\n      title: \"完整样例-班级\",\n      description: \"完整样例-班级-描述\",\n      type: \"object\",\n      required: [\"grade\", \"classinfo\"],\n      properties: {\n        teacher: {\n          title: \"班主任\",\n          description: \"嵌套Object 班主任 描述\",\n          type: \"object\",\n          required: [\"name\"],\n          properties: {\n            name: {\n              type: \"string\",\n              title: \"姓名\",\n              description: \"班主任老师名称\",\n              default: \"李老师\"\n            },\n            remark: {\n              type: \"string\",\n              widget: \"textarea\",\n              title: \"备注\"\n            },\n            isSpecial: {\n              type: \"boolean\",\n              widget: \"switch\",\n              title: \"特级教师\"\n            }\n          }\n        },\n        subject: {\n          type: \"array\",\n          title: \"课程\",\n          items: {\n            title: \"课程名称\",\n            type: \"string\",\n            default: \"语文\"\n          }\n        },\n        grade: {\n          type: \"string\",\n          title: \"年级\",\n          default: \"高一\"\n        },\n        classinfo: {\n          type: \"string\",\n          title: \"班级信息\",\n          widget: \"textarea\",\n          default: \"这是高一11班\"\n        },\n        nums: {\n          type: \"integer\",\n          title: \"人数\",\n          widget: \"step\",\n          default: 20\n        },\n        kind: {\n          title: \"类型\",\n          type: \"string\",\n          enum: [\"文科\", \"理科\"]\n        },\n        students: {\n          title: \"学员\",\n          type: \"array\",\n          items: {\n            type: \"object\",\n            required: [\"name\", \"sex\"],\n            properties: {\n              name: {\n                title: \"姓名\",\n                type: \"string\",\n                default: \"学生甲\"\n              },\n              sex: {\n                title: \"性别\",\n                type: \"string\",\n                description: \"学员的性别\",\n                enum: [\"男\", \"女\"],\n                default: \"男\"\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n},\nmethods: {\n  handleChange(val) {\n  }\n}\n\n```\n\n## API\n\n### Attributes\n| 参数          | 说明            | 类型            | 可选值                 | 默认值   |\n|------------- |---------------- |---------------- |---------------------- |-------- |\n| schema       | schema结构       | Object         |          {}           |    —    |\n| formData     | 初始数据          | Object         |         {}             |     —    |\n\n### Events\n| 参数          | 说明            | 回调参数           |\n|------------- |---------------- |---------------- |\n| onDataChange | change事件       | 返回当前表单填写的数据   |\n\n### todo\n1.循环引用\n2.v1.2.0","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftggcs%2Fschema-json-vue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftggcs%2Fschema-json-vue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftggcs%2Fschema-json-vue/lists"}