{"id":19495413,"url":"https://github.com/nu-system/vue-axios-form","last_synced_at":"2026-01-30T06:36:07.371Z","repository":{"id":57093889,"uuid":"193636197","full_name":"nu-system/vue-axios-form","owner":"nu-system","description":"一个基于 axios 利用 Form 表单的 dom 结构，发送 request 请求的组件。","archived":false,"fork":false,"pushed_at":"2019-08-20T09:28:42.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-31T08:35:27.842Z","etag":null,"topics":["axios","form","ui-components","vue-components"],"latest_commit_sha":null,"homepage":"https://nu-system.github.io/vue/axios-form/","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/nu-system.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-06-25T04:46:09.000Z","updated_at":"2019-08-20T09:28:44.000Z","dependencies_parsed_at":"2022-08-22T18:20:57.579Z","dependency_job_id":null,"html_url":"https://github.com/nu-system/vue-axios-form","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nu-system/vue-axios-form","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nu-system%2Fvue-axios-form","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nu-system%2Fvue-axios-form/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nu-system%2Fvue-axios-form/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nu-system%2Fvue-axios-form/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nu-system","download_url":"https://codeload.github.com/nu-system/vue-axios-form/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nu-system%2Fvue-axios-form/sbom","scorecard":{"id":697933,"data":{"date":"2025-08-11","repo":{"name":"github.com/nu-system/vue-axios-form","commit":"592d23b40802304c801dbbb42ec6a1716164b12e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"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":"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":"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":"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/5 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":"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":"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":"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":"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":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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 '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-22T04:15:25.342Z","repository_id":57093889,"created_at":"2025-08-22T04:15:25.343Z","updated_at":"2025-08-22T04:15:25.343Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28906668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T04:02:34.702Z","status":"ssl_error","status_checked_at":"2026-01-30T04:02:33.562Z","response_time":66,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["axios","form","ui-components","vue-components"],"created_at":"2024-11-10T21:37:40.000Z","updated_at":"2026-01-30T06:36:07.344Z","avatar_url":"https://github.com/nu-system.png","language":"Vue","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nu-vue-axios-form\n\n[![npm package][npm-badge]][npm]\n\n[npm-badge]: https://img.shields.io/npm/v/npm-package.png?style=flat-square\n[npm]: https://www.npmjs.org/package/@_nu/vue-axios-form\n\n一个基于 axios 利用 Form 表单的 dom 结构， 发送 request 请求的组件。\n\n## Setup\n\n```bash\n$ yarn add @_nu/vue-axios-form\n```\n\n## Usage\n\n```vue\n\u003ctemplate\u003e\n    \u003cdiv\u003e\n        \u003cNuAjaxForm\n            action=\"//www.mocky.io/v2/5cee2090300000013a6e98c9?mocky-delay=1000ms\"\n            @onSuccess=\"handelSuccess\"\n        \u003e\n            \u003cp\u003eclick the button below will send a request and get a respones after 1000ms\u003c/p\u003e\n            \u003cbutton type=\"submit\"\u003eclick and send a request\u003c/button\u003e\n            \u003cspan slot=\"success\"\u003erequest success\u003c/span\u003e\n            \u003cspan slot=\"loading\"\u003eloading...\u003c/span\u003e\n            \u003cspan slot=\"error\"\u003eerror\u003c/span\u003e\n        \u003c/NuAjaxForm\u003e\n    \u003c/div\u003e\n\u003c/template\u003e\n\u003cscript\u003e\n    import NuAjaxForm from \"@_nu/vue-axios-form\"    \n    export default {\n        components: { NuAjaxForm },\n        methods: {\n            handelSuccess(response) {\n                console.log('handelSuccess', response);\n            }\n        }\n    }\n\u003c/script\u003e\n```\n\n\u003cClientOnly\u003e\n\u003cAxiosFormDemo/\u003e\n\u003c/ClientOnly\u003e\n\n你只需要写一个完整的 form 表单，就可以实现一个 request 请求，并且监听到整个的生命周期。\n\n## Api\n\n| props   |      类型      | 默认值  | 介绍 |\n|:----------|:-------------|:------:|------:|\n| [:defaultSubmit](#defaultSubmit) |  Boolean | false | 是否初始化的时候就发送 request 请求 |\n| [:status](#status) |  string | null | request status |\n| [:action](#action) |  String | - | server URL that will be used for the request |\n| :method | String | 'get' | request method  |\n| :params | Object | null | URL parameters to be sent with the request |\n| :config | Object | null | [axios](https://github.com/axios/axios) config |\n| @onSuccess | Function | return response | callback when request get response |\n| @onError | Function | return error | callback when request error |\n\n### defaultSubmit\n\n```jsx\n\u003cNuAjaxForm :defaultSubmit=\"true\" /\u003e\n```\n\n只需将 `defaultSubmit` 设置为 `true`, `NuAjaxForm`一但创建 request 请求就默认触发。\n\n### status\n\n```jsx \n\u003cNuAjaxForm status=\"placeholder\"\u003e\n    \u003cspan slot=\"placeholder\"\u003eplaceholder\u003c/span\u003e\n    \u003cspan slot=\"success\"\u003erequest success\u003c/span\u003e\n    \u003cspan slot=\"loading\"\u003eloading...\u003c/span\u003e\n    \u003cspan slot=\"error\"\u003eerror\u003c/span\u003e\n\u003c/NuAjaxForm\u003e\n```\n\n- `loading`: 当 request 触发时，status 会被设置为 loading；\n- `success`: 当 request 请求成功，status 会被设置为 success；\n- `error`: 当 request 请求失败，status 会被设置为 error；\n\nstatus 名称是什么，NuAjaxForm 内部相同名称的 slot 会显示。\n\n组件内部只会自动切换以上这三个状态。但是你可以为 status 设置任意的文案。\n\n所以在这个事例中只有 `slot=\"placeholder\"` 的 dom 会输出。\n\n```jsx\n\u003cNuAjaxForm ref=\"axioForm\" /\u003e\n\nthis.$refs.axioForm.changeStatus('placeholder');\n```\n\n也可以在外面通过触发子组件的 changeStatus 方法来手动更新 status 的值。\n\n### action\n\n虽然 action 并不是 required，但是当 action 不存在时，整个 request 生命周期并不会创建。\n\n### form submit\n\n这里的所有事件都基于表单的 submit 事件，只要表单的 submit 事件被触发，整个 request 流程就会重新触发。\n\n```jsx\n\u003cNuAjaxForm ref=\"axioForm\" /\u003e\n\nthis.$refs.axioForm.submit();\n```\n\n所以你可以通过 ref 触发子组件的 submit 事件来触发 requset 请求。\n\n\n```jsx\n\u003cNuAjaxForm ref=\"axioForm\"\u003e\n    \u003cbutton type=\"submit\"\u003eclick and send a request\u003c/button\u003e\n\u003c/NuAjaxForm\u003e\n```\n\n也可以通过在 NuAjaxForm 里面放一个  `[type=\"submit\"]` 的按钮，然后点击这个按钮触发 requset 请求。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnu-system%2Fvue-axios-form","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnu-system%2Fvue-axios-form","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnu-system%2Fvue-axios-form/lists"}