{"id":13715923,"url":"https://github.com/callmedadaxin/custom-form","last_synced_at":"2025-05-08T03:20:08.482Z","repository":{"id":128073521,"uuid":"85845260","full_name":"callmedadaxin/custom-form","owner":"callmedadaxin","description":"后端可配表单，搭配element-ui","archived":false,"fork":false,"pushed_at":"2017-04-16T08:33:36.000Z","size":48,"stargazers_count":42,"open_issues_count":0,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T16:59:18.938Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/callmedadaxin.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-03-22T15:34:01.000Z","updated_at":"2021-12-13T10:41:50.000Z","dependencies_parsed_at":"2024-01-14T21:28:26.859Z","dependency_job_id":null,"html_url":"https://github.com/callmedadaxin/custom-form","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callmedadaxin%2Fcustom-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callmedadaxin%2Fcustom-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callmedadaxin%2Fcustom-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/callmedadaxin%2Fcustom-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/callmedadaxin","download_url":"https://codeload.github.com/callmedadaxin/custom-form/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252990430,"owners_count":21836750,"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":[],"created_at":"2024-08-03T00:01:05.085Z","updated_at":"2025-05-08T03:20:08.464Z","avatar_url":"https://github.com/callmedadaxin.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# vue-custom-form\n\n\u003e 根据字段，自动生成表单，表单内容依赖element-ui,支持表单验证\n\n## demo\n```\nnpm run example\n```\n\n## 安装\n\n``` \nnpm i element-ui -S\n```\n\n### 引用\n\n```\nimport Vue from 'vue'\nimport ElementUI from 'element-ui'\nimport 'element-ui/lib/theme-default/index.css'\n\n//引用custom-form\nimport CustomForm from './scusorm-form/index.js'\n\nVue.use(ElementUI)\nVue.use(CustomForm)\n```\n\n### 使用\n\n```\n\u003ctemplate\u003e\n  \u003ccustom-form \n    name=\"test\" \n    @on-submit=\"onSubmit\"  \n    :items=\"formRule\" \n    :data=\"data\" \n    :rules=\"rules\"\u003e\n  \u003c/custom-form\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport CustomForm from 'custom-form';\n\nexport default {\n  data () {\n    return {\n      formRule: {\n        name: {\n          type: 'input',\n          label: '活动名称',\n          placeholder: '请输入活动名称',\n        },\n        region: {\n          type: 'select',\n          label: '活动区域',\n          placeholder: '请选择活动区域',\n          options: [{\n            label: '区域一',\n            value: 'shanghai',\n          },{\n            label: '区域二',\n            value: 'beijing'\n          }]\n        },\n        delivery: {\n          type: 'switch',\n          label: '及时配送'\n        },\n        ...\n      },\n      data: {\n        name: '',\n        region: '',\n        date: '',\n        delivery: false,\n        ...\n      },\n      rules: {\n        name: [\n          { required: true, message: '请输入活动名称', trigger: 'blur' },\n          { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }\n        ],\n        region: [\n          { required: true, message: '请选择活动区域', trigger: 'change' }\n        ],\n        ...\n      }\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcallmedadaxin%2Fcustom-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcallmedadaxin%2Fcustom-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcallmedadaxin%2Fcustom-form/lists"}