{"id":20140246,"url":"https://github.com/10quality/vue-form","last_synced_at":"2025-10-12T08:16:35.045Z","repository":{"id":58217552,"uuid":"63711742","full_name":"10quality/vue-form","owner":"10quality","description":"Form handling component for VueJS.","archived":false,"fork":false,"pushed_at":"2017-10-24T22:09:33.000Z","size":31,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"v2.0","last_synced_at":"2025-09-27T12:29:11.959Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/10quality.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-19T16:49:15.000Z","updated_at":"2019-06-11T11:56:34.000Z","dependencies_parsed_at":"2022-08-30T20:00:24.576Z","dependency_job_id":null,"html_url":"https://github.com/10quality/vue-form","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/10quality/vue-form","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10quality%2Fvue-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10quality%2Fvue-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10quality%2Fvue-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10quality%2Fvue-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/10quality","download_url":"https://codeload.github.com/10quality/vue-form/tar.gz/refs/heads/v2.0","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10quality%2Fvue-form/sbom","scorecard":{"id":1120,"data":{"date":"2025-08-11","repo":{"name":"github.com/10quality/vue-form","commit":"d271722acea31505af3552cf80b12a99790c125d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/22 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'v2.0'","Warn: branch protection not enabled for branch 'v1.0'","Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-14T12:32:47.755Z","repository_id":58217552,"created_at":"2025-08-14T12:32:47.755Z","updated_at":"2025-08-14T12:32:47.755Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010803,"owners_count":26084807,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-13T21:49:52.721Z","updated_at":"2025-10-12T08:16:35.023Z","avatar_url":"https://github.com/10quality.png","language":"JavaScript","funding_links":[],"categories":["Awesome Vue.js [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)","Awesome Vue.js"],"sub_categories":["Libraries \u0026 Plugins"],"readme":"# Form Component (for [Vue](http://vuejs.org/))\n\n[![GitHub version](https://badge.fury.io/gh/10quality%2Fvue-form.svg)](https://badge.fury.io/gh/10quality%2Fvue-form)\n[![Bower version](https://badge.fury.io/bo/10q-vue-form.svg)](https://badge.fury.io/bo/10q-vue-form)\n\nForm handler component for [Vue](http://vuejs.org/) v2.\n\n**NOTE** Use [v1.0 branch](https://github.com/10quality/vue-form/tree/v1.0) to use this with Vue v1.\n\nView [DEMO](http://codepen.io/amostajo/pen/vKdPbj).\n\n## Package index\n- [Installation](#installation)\n- [Usage](#usage)\n    - [Props](#props)\n    - [Request](#request)\n    - [Response](#response)\n        - [Redirection](#redirection)\n    - [Results](#results)\n        - [Props](#props-1)\n    - [Input handling](#input-handling)\n        - [Props](#props-2)\n        - [Validations](#validations)\n    - [Events](#events)\n- [License](#license)\n\n## Installation\n\nSeveral installation options are available:\n\n- [Download the latest release](https://github.com/10quality/vue-form/releases).\n- Install with [Bower](http://bower.io): `bower install 10q-vue-form`.\n\n## Usage\n\nAdd the following resources for the component to function correctly.\n\n```html\n\u003c!-- Required Javascript --\u003e\n\u003cscript src=\"vue.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"vue-resource.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"[component path]/dist/vue.form.min.js\"\u003e\u003c/script\u003e\n```\n\nAdd the component in your vue view.\n\n```html\n\u003c!-- Assuming your view app is APP. --\u003e\n\u003cdiv id=\"app\"\u003e\n\n    \u003cvform inline-template\n        action=\"http://some.url.com\"\n        method=\"POST\"\n    \u003e\n\n        \u003cinput type=\"email\" v-model=\"request.email\"\u003e\n\n        \u003cbutton @click=\"submit\"\u003eSubmit\u003c/button\u003e\n\n        \u003cspan v-if=\"isLoading\"\u003eLoading...\u003c/span\u003e\n\n    \u003c/vform\u003e\n\n\u003c/div\u003e\n```\n\n*NOTE:* `inline-template` must be present.\n\n### Props\n\nList of available props to use in component:\n\nProp            | Data Type  | Default  | Description\n--------------- | ---------- | -------- | -----------\n`action`        | String     |          | Action URL where to send form data.\n`method`        | String     | POST     | Request method (i.e. GET or POST).\n`headers`       | Object     |          | Request headers ([reference](https://github.com/vuejs/vue-resource/blob/master/docs/http.md#options)).\n`timeout`       | Number     |          | Request headers ([reference](https://github.com/vuejs/vue-resource/blob/master/docs/http.md#options)).\n`credentials`   | Boolean    |          | Flag that indicates if request has credentials ([reference](https://github.com/vuejs/vue-resource/blob/master/docs/http.md#options)).\n`emulate-http`  | Boolean    |          | Flag that indicates if request should emulate HTTP ([reference](https://github.com/vuejs/vue-resource/blob/master/docs/http.md#options)).\n`emulate-json`  | Boolean    |          | Flag that indicates if request should emulate JSON ([reference](https://github.com/vuejs/vue-resource/blob/master/docs/http.md#options)).\n`errors`        | Object     | Object   | List of default validation rules error messages.\n`id`            | String     |          | Form given ID.\n`key`           | String     |          | Form given loop key (i.e. in case of being used inside a v-for).\n`response-json` | Boolean    | false    | Forces response to be returned and parsed as JSON.\n`response-blob` | Boolean    | false    | Forces response to be returned as Blob.\n\n### Request\n\nData sent by form should be binded to the `request` data model. In other words, all the inputs within the form should be binded to request.\n\nAs reference, a basic contact form sample:\n\n```html\n\u003cdiv id=\"app\"\u003e\n\n    \u003cvform inline-template action=\"http://some.url.com\"\u003e\n\n        \u003clabel for=\"name\"\u003eName:\u003c/label\u003e\n        \u003cinput type=\"text\"\n            id=\"name\"\n            v-model=\"request.name\"\n        /\u003e\n\n        \u003clabel for=\"email\"\u003eEmail:\u003c/label\u003e\n        \u003cinput type=\"email\"\n            id=\"email\"\n            v-model=\"request.email\"\n        /\u003e\n\n        \u003clabel for=\"message\"\u003eTextarea:\u003c/label\u003e\n        \u003ctextarea id=\"message\"\n            v-model=\"request.message\"\n        \u003e\u003c/textarea\u003e\n\n        \u003cbutton @click=\"submit\"\u003eSubmit\u003c/button\u003e\n\n    \u003c/vform\u003e\n\n\u003c/div\u003e\n```\n\n### Response\n\nAny response obtained from a request is set to the `response` data model.\n\nIf the following data is found, the form will *auto-process* the response (json) to facilitate its handling:\n\n```json\n{\n    \"error\": true,\n    \"message\": \"Contact information not sent.\"\n}\n```\n\nThis response can be displayed in the template like:\n\n```html\n\u003cdiv id=\"app\"\u003e\n\n    \u003cvform inline-template\u003e\n\n        \u003cdiv v-if=\"hasMessage\"\n            :class=\"{'with-error': hasError}\"\n        \u003e\n            {{response.message}}\n        \u003c/div\u003e\n\n    \u003c/vform\u003e\n\n\u003c/div\u003e\n```\n\nComputed properties to use in template:\n\nProperty       | Data Type  | Description\n-------------- | ---------- | -------------------\n`isLoading`    | Boolean    | Flag that indicates if form is loading, processing or waiting for response.\n`hasMessage`   | Boolean    | Flag that indicates if form response returned a message to display.\n`hasError`     | Boolean    | Flag that indicates if form response returned as error.\n\nAnother example using Bootstrap:\n\n```html\n\u003cdiv id=\"app\"\u003e\n\n    \u003cvform inline-template\u003e\n\n        \u003cdiv v-show=\"hasMessage\"\n            class=\"alert\"\n            :class=\"{'alert-danger': hasError, 'alert-success': !hasError}\"\n        \u003e\n            {{response.message}}\n        \u003c/div\u003e\n\n    \u003c/vform\u003e\n\n\u003c/div\u003e\n```\n\n#### Redirection\n\nIf the following data is found, the form will redirect the current window to the value set in `response.redirect`:\n\n```json\n{\n    \"error\": false,\n    \"message\": \"Information sent.\",\n    \"redirect\": \"http://some.url.com\"\n}\n```\n\n### Results\n\nForm comes with a child component called `results`. This component will facilitate the handling of data returned by request (thought for searches).\n\n```html\n\u003cdiv id=\"app\"\u003e\n\n    \u003cvform inline-template\u003e\n\n        \u003clabel\u003eSearch:\u003c/label\u003e\n        \u003cinput type=\"text\"\n            v-model=\"request.q\"\n            @keyup.enter=\"submit\"\n        /\u003e\n\n        \u003cresults inline-template\n            v-model=\"response\"\n            fetch-on-ready=\"true\"\n            clear-on-fetch=\"false\"\n        \u003e\n            \n            \u003cdiv v-show=\"hasRecords\"\u003e\n                \u003cdiv v-for=\"record in records\"\u003e\n                    {{record | json}}\n                \u003c/div\u003e\n            \u003c/div\u003e\n\n        \u003c/results\u003e\n\n    \u003c/vform\u003e\n\n\u003c/div\u003e\n```\n\nIn the example above, `results` child component is handling search results returned by the response (assuming `response` contains only results) and it is computing them into a property called `records`.\n\n*NOTE:* Results will compute records only if the model is an array.\n*NOTE:* `inline-template` must be present.\n\n#### Props\n\nList of available props to use in child component:\n\nProp             | Data Type  | Default  | Description\n---------------- | ---------- | -------- | -----------\n`model`          | Array      |          | Data to compute for results (mostly required).\n`request`        | Object     |          | If form request is needed to be binded to results.\n`fetch-onready`  | Boolean    | false    | Flag that forces form to submit and return response when `document` is *ready*.\n`clear-on-fetch` | Boolean    | true     | Flag that indicates if records should stack on every submission or not. (used for eager loading)\n\nAnother example:\n\n```html\n\u003cdiv id=\"app\"\u003e\n\n    \u003cvform inline-template\u003e\n\n        \u003cresults inline-template v-model=\"response.results\"\u003e\n            \n                \u003cdiv v-for=\"record in records\"\u003e\n                    {{record | json}}\n                \u003c/div\u003e\n\n        \u003c/results\u003e\n\n    \u003c/vform\u003e\n\n\u003c/div\u003e\n```\n\n### Input handling\n\nForm comes with a second child component called `input-handler`. This component will facilitate the display of errors per input, improving UX.\n\nExample using Bootstrap:\n\nResponse:\n\n```json\n{\n    \"errors\": [\n        \"email\": [\n            \"Email is invalid.\",\n            \"Fields is required.\"\n        ],\n        \"name\": [\n            \"Too short\".\n        ]\n    ]\n}\n```\n\nIn template:\n\n```html\n\u003cdiv id=\"app\"\u003e\n\n    \u003cvform inline-template\u003e\n\n        \u003cinput-handler class=\"form-group\"\n            class-error=\"has-error\"\n            listen=\"name\"\n            v-model=\"response\"\n        \u003e\n            \u003clabel for=\"name\"\u003eName\u003c/label\u003e\n            \u003cinput type=\"text\"\n                class=\"form-control\"\n                id=\"name\"\n                v-model=\"request.name\"\n            /\u003e\n        \u003c/input-handler\u003e\n\n        \u003cinput-handler class=\"form-group\"\n            class-error=\"has-error\"\n            listen=\"email\"\n            v-model=\"response\"\n        \u003e\n            \u003clabel for=\"email\"\u003eEmail\u003c/label\u003e\n            \u003cinput type=\"email\"\n                class=\"form-control\"\n                id=\"email\"\n                v-model=\"request.email\"\n            /\u003e\n        \u003c/input-handler\u003e\n\n    \u003c/vform\u003e\n\n\u003c/div\u003e\n```\n\nIn the example above, the response returned a list of errors per input. `input-handler` will process the response and if errors are found (response must be passed as `v-model`), it will add an error class to the input wrapper and will list the erros under the input using a `\u003cul class=\"errors\"\u003e` HTML tag.\n\n#### Props\n\nList of available props to use in child component:\n\nProp             | Data Type  | Default  | Description\n---------------- | ---------- | -------- | -----------\n`listen`         | String     |          | Name of the error key (in response) to listen to.\n`class`          | String     |          | CSS class to apply to wrapper. (`\u003cdiv\u003e`)\n`class-error`    | String     |          | CSS class to apply to wrapper when errors are available.\n`response`       | Object     |          | Response to process. (required)\n`validations`    | String     |          | List of validation rules to apply to input.\n\n#### Validations\n\nForm comes with a set of validation rules that can be applied to input values prior request. This are set in the `validations` prop, separated by `|`.\n\nIn the following example, the input will validate that name is not empty (is a required field) and that it has at least 8 characters:\n\n```html\n\u003cdiv id=\"app\"\u003e\n\n    \u003cvform inline-template\u003e\n\n        \u003cinput-handler class=\"form-group\"\n            class-error=\"has-error\"\n            listen=\"name\"\n            v-model=\"response\"\n            validations=\"required|min:8\"\n        \u003e\n            \u003clabel for=\"name\"\u003eName\u003c/label\u003e\n            \u003cinput type=\"text\"\n                class=\"form-control\"\n                id=\"name\"\n                v-model=\"request.name\"\n            /\u003e\n        \u003c/input-handler\u003e\n\n    \u003c/vform\u003e\n\n\u003c/div\u003e\n```\n\nList of available rules to use:\n\nRule             | Params                                            | Sample                 | Description\n---------------- | ------------------------------------------------  | ---------------------- | -----------\n`required`       |                                                   | `required`             | Validates if value is not empty.\n`required_if`    | 1) comparison field                               | `required_if:email`    | Validates if value is not empty only if comparison field is not empty.\n`email`          |                                                   | `email`                | Validates if value has a valid email format.\n`number`         |                                                   | `number`               | Validates if value is numeric.\n`min`            | 1) minimum string length                          | `min:2`                | Validates if value's length is not lower than the minimum value set.\n`min_number`     | 1) minimum number                                 | `min_number:10`        | Validates if value is not lower than the minimum value set.\n`max`            | 1) maximum string length                          | `max:10`               | Validates if value's length is not bigger than the maximum value set.\n`max_number`     | 1) maximum number length                          | `max_number:15`        | Validates if value is not bigger than the maximum value set.\n`between`        | 1) minimum string length 2) maximum string length | `between:5:10`         | Validates if value's length is in between the number range set.\n`between_number` | 1) minimum number 2) maximum number               | `between_number:1:100` | Validates if value is in between the number range set.\n`equals`         | 1) comparison field                               | `equals:password`      | Validates if value is the same as comparison field's value.\n`url`            |                                                   | `url`                  | Validates if value has a valid url format.\n\n### Events\n\nEvents dispatched by form:\n\nEvent      | Data sent                    | Description\n---------- | ---------------------------- | -------------------\n`success`  |                              | Emitted once response is returned and assigned to model `response`.\n`error`    | `e` Error response returned. | Emitted on request error. (Error is thrown to console too).\n`complete` |                              | Emitted after request completed. (Success or error)\n`invalid`  | `errors` List of errors.     | Emitted and broadcasted when a validation ocurred.\n\nUsage example:\n```html\n\u003cdiv id=\"app\"\u003e\n    \u003cvform inline-template\n        @success=\"eventHandlerMethod\"\n        @error=\"eventHandlerMethod\"\n        @complete=\"eventHandlerMethod\"\n        @invalid=\"eventHandlerMethod\"\n    \u003e\u003c/vform\u003e\n\u003c/div\u003e\n```\n\n## License\n\nCopyright (c) 2017 [10Quality](http://www.10quality.com/). Under MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F10quality%2Fvue-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F10quality%2Fvue-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F10quality%2Fvue-form/lists"}