{"id":22351422,"url":"https://github.com/codetheorist/vue-dynamic-form","last_synced_at":"2025-07-16T04:42:03.028Z","repository":{"id":57395692,"uuid":"101894539","full_name":"codetheorist/vue-dynamic-form","owner":"codetheorist","description":"A dynamic entity form component for VueJS. Simple to use, just pass the required field prop and optional entity prop.","archived":false,"fork":false,"pushed_at":"2017-08-30T20:11:41.000Z","size":19,"stargazers_count":7,"open_issues_count":3,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-03T08:58:32.727Z","etag":null,"topics":["forms","javascript","trumbowyg","vuejs2"],"latest_commit_sha":null,"homepage":"","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/codetheorist.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":"2017-08-30T14:54:24.000Z","updated_at":"2023-08-21T15:39:45.000Z","dependencies_parsed_at":"2022-09-09T20:01:27.516Z","dependency_job_id":null,"html_url":"https://github.com/codetheorist/vue-dynamic-form","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codetheorist/vue-dynamic-form","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codetheorist%2Fvue-dynamic-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codetheorist%2Fvue-dynamic-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codetheorist%2Fvue-dynamic-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codetheorist%2Fvue-dynamic-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codetheorist","download_url":"https://codeload.github.com/codetheorist/vue-dynamic-form/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codetheorist%2Fvue-dynamic-form/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265482198,"owners_count":23774016,"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":["forms","javascript","trumbowyg","vuejs2"],"created_at":"2024-12-04T12:13:57.270Z","updated_at":"2025-07-16T04:42:03.004Z","avatar_url":"https://github.com/codetheorist.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vue Dynamic Form\n\n## Installation\n\nTo install Vue Dynamic Form, simply run `npm install vue-dynamic-form --save`. This will install Vue Dynamic Form as a Node module, ready for you to import into your projects.\n\nAlternatively, you can manually download and include the JS file manually from the Github repository.\n\n## Usage\n\nTo use Vue Dynamic Form, simply import the component using `import VueDynamicComponent from 'vue-dynamic-component'` and add the custom element to your form wrapper, like so:\n\n```\n\u003ctemplate\u003e\n    \u003cdiv id=\"form-wrapper\"\u003e\n        \u003cvue-dynamic-form @submit-form=\"submitForm\" :fields=\"fields\" :entity=\"entity\"\u003e\u003c/vue-dynamic-form\u003e\n    \u003c/div\u003e\n\u003c/template\u003e\n```\n\nThe component takes 2 props - the fields prop which is a required prop and the entity prop, which is optional and should provide the default values for the form. \n\nThe component also emits a `submit-form` event, as seen above. Setup a method in your form wrapper component to process the submitted data like follows:\n\n```\n\u003cscript\u003e\n    export default {\n        name: 'form-wrapper',\n        data () {\n            return {\n                ...\n            }\n        },\n        methods: {\n            submitForm(value) {\n                console.log(value)\n            }\n        }\n    }\n\u003c/script\u003e\n```\n\nThe `value` variable contains an array of key/value pairs of your form data, to process however you choose. The example above will simply print the array to the console.\n\n## Complete Single File Component Example\n\nBelow is a sample Single File Component for VueJS, that gives an example of what the fields prop and the entity prop should contain, as well as an example submit handler that simply logs the form data:\n\n```\n\u003ctemplate\u003e\n    \u003cdiv id=\"form-wrapper\"\u003e\n        \u003cvue-dynamic-form @submit-form=\"submitForm\" :fields=\"fields\" :entity=\"entity\"\u003e\u003c/vue-dynamic-form\u003e\n    \u003c/div\u003e\n\u003c/template\u003e\n\u003cscript\u003e\n  import VueDynamicForm from 'vue-dynamic-form'\n  export default {\n    name: 'edit-form-tester',\n    methods: {\n      submitForm(data) {\n        console.log(data)\n      }\n    },\n    data () {\n      return {\n        fields: [\n          {\n            name: 'title',\n            label: 'Title',\n            type: 'text'\n          },\n          {\n            name: 'yes-no',\n            label: 'Yes or No?',\n            type: 'select',\n            options: {\n              yes: 'Yes',\n              no: 'No'\n            }\n          },\n          {\n            name: 'body',\n            label: 'Body',\n            type: 'textarea',\n            rows: 8,\n            cols: 30\n          }\n        ],\n        entity: {\n          'yes-no': 'yes',\n          body: '\u003cp\u003eWelcome to paradise\u003c/p\u003e\u003cp\u003eHave another paragraph on me.\u003c/p\u003e',\n          title: 'Hello World'\n        }\n      }\n    },\n    components: {\n      VueDynamicForm\n    }\n  }\n\u003c/script\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodetheorist%2Fvue-dynamic-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodetheorist%2Fvue-dynamic-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodetheorist%2Fvue-dynamic-form/lists"}