{"id":13535904,"url":"https://github.com/saivarunk/vue-simple-upload","last_synced_at":"2025-04-06T12:10:21.682Z","repository":{"id":15616112,"uuid":"78508015","full_name":"saivarunk/vue-simple-upload","owner":"saivarunk","description":"Simple File upload component for Vue.js","archived":false,"fork":false,"pushed_at":"2022-12-06T23:14:41.000Z","size":273,"stargazers_count":148,"open_issues_count":20,"forks_count":30,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-14T13:13:24.414Z","etag":null,"topics":["vue","vue-component","vue-components"],"latest_commit_sha":null,"homepage":"https://saivarunk.github.io/vue-simple-upload/","language":"HTML","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/saivarunk.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-01-10T07:17:44.000Z","updated_at":"2023-11-10T09:01:44.000Z","dependencies_parsed_at":"2023-01-11T20:23:40.963Z","dependency_job_id":null,"html_url":"https://github.com/saivarunk/vue-simple-upload","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/saivarunk%2Fvue-simple-upload","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saivarunk%2Fvue-simple-upload/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saivarunk%2Fvue-simple-upload/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saivarunk%2Fvue-simple-upload/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saivarunk","download_url":"https://codeload.github.com/saivarunk/vue-simple-upload/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478323,"owners_count":20945266,"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":["vue","vue-component","vue-components"],"created_at":"2024-08-01T09:00:31.611Z","updated_at":"2025-04-06T12:10:21.657Z","avatar_url":"https://github.com/saivarunk.png","language":"HTML","funding_links":[],"categories":["UI组件","Awesome Vue.js [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome)","Components \u0026 Libraries","UI Components","UI Components [🔝](#readme)"],"sub_categories":["Component Collections","形成","UI Components","Form"],"readme":"# vue-simple-upload\n\n[![npm](https://img.shields.io/npm/v/vue-simple-upload.svg) ![npm](https://img.shields.io/npm/dm/vue-simple-upload.svg)](https://www.npmjs.com/package/vue-simple-upload)\n[![vue2](https://img.shields.io/badge/vue-2.x-brightgreen.svg)](https://vuejs.org/)\n[![Build Status](https://secure.travis-ci.org/saivarunk/vue-simple-upload.png?branch=master)](https://travis-ci.org/saivarunk/vue-simple-upload)\n\nAn simple file upload component for vue.js.\n\nCheckout Demo on [JSFiddle](https://jsfiddle.net/saivarunk/o9vwjnar/)\n\n## Installation\n\n`npm install vue-simple-upload`\n\n## Usage\nvue-simple-upload is a UMD module, which can be used as a module in both CommonJS and AMD modular environments.\nWhen in non-modular environment, FileUpload will be registered as a global variable.\u003c/p\u003e\n\n### ES6\n```js\n\nimport FileUpload from 'vue-simple-upload/dist/FileUpload'\n\nexport default {\n  ...\n  components: {\n    'fileupload': FileUpload\n  },\n  ...\n}\n```\nAfter that, you can use it in your templates:\n\n```html\n\u003cfileupload target=\"http://localhost:8000/api/upload\" action=\"POST\"\u003e\u003c/fileupload\u003e\n```\n\n### CommonJS\n```js\nvar Vue = require('vue')\nvar FileUpload = require('vue-simple-upload')\n\nvar YourComponent = Vue.extend({\n  ...\n  components: {\n    'fileupload': FileUpload.FileUpload\n  },\n  ...\n})\n```\n\n### Browser\n\n```html\n\u003cscript src=\"path/to/vue/vue.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"path/to/vue-simple-upload/dist/vue-simple-upload.min.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\nnew Vue({\n  ...\n  components: {\n    'fileupload': FileUpload.FileUpload\n  },\n  ...\n})\n\u003c/script\u003e\n```\n## Usage \n\n```vue\n\u003ctemplate\u003e\n\u003cfileupload target=\"http://localhost:8000/api/upload\" action=\"POST\" v-on:progress=\"progress\" v-on:start=\"startUpload\" v-on:finish=\"finishUpload\"\u003e\u003c/fileupload\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nnew Vue({\n  ...\n  components: {\n    'fileupload': FileUpload.FileUpload\n  },\n  methods: {\n    startUpload(e) {\n      // file upload start event\n      console.log(e);\n    },\n    finishUpload(e) {\n      // file upload finish event\n      console.log(e);\n    },\n    progress(e) {\n      // file upload progress\n      // returns false if progress is not computable\n      console.log(e);\n    }\n  }\n})\n\u003c/script\u003e\n```\n\n## Props\n\n - target (String):\n   Target endpoint to upload the file\n\n - action (String):\n   Target action ( POST or PUT )\n\n\n## Events\n\nYou can access the file upload events using v-on methods.\n\n- File Upload start event:\n  You can access the start event using v-on:start=\"startUpload\"\n\n```js\n\nmethods() {\n  startUpload(e) {\n    // start event\n  }\n}\n\n```\n\n- File Upload finish event:\n  You can access the start event using v-on:finish=\"finishUpload\"\n\n```js\n\nmethods() {\n  finishUpload(e) {\n    // finish event\n  }\n}\n\n```\n\n- File Upload progress event:\n  You can access the file upload progress using v-on:progress=\"progress\"\n\n```js\n\nmethods() {\n  progress(e) {\n    // listen to file upload progress\n  }\n}\n\n```\n\n## Todos\n\n- Multi File Upload\n\n## License\n\nReleased under the [MIT](LICENCE) License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaivarunk%2Fvue-simple-upload","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaivarunk%2Fvue-simple-upload","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaivarunk%2Fvue-simple-upload/lists"}