基于vue2+plupload的阿里云OSS上传组件(支持断
vue_oss
注: 使用完毕记得关闭cors
Build Setup
demo :oos upload
地址: http://sherry255.github.io/vue-oss/
因为跨域(这个demo是用的阿里云文档上给的demo的接口,所以会有跨域)的问题, 必须按照以下操作, demo才能完整展示: 安装插件: https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi/reviews?hl=zh-CN 启用cors# 安装前准备 1. 更换淘宝源: npm install -g cnpm --registry=https://registry.npm.taobao.org 2. 检查包的更新: cnpm i -g npm-check-updates npm-check-updates -u # 安装 cnpm install # 修改你的接口: 参考服务端签名后直传文档:https://help.aliyun.com/document_detail/31926.html 将此处( https://github.com/sherrycherish/vue-oss/blob/master/src/components/Upload.vue#L68 )的 serverUrl 换成你的接口地址: # serve with hot reload at localhost:8080 npm run dev # build for production with minification npm run build # build for production and view the bundle analyzer report npm run build --report # run unit tests npm run unit # run e2e tests npm run e2e # run all tests npm test
版权声明:
1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。2、网站不提供资料下载,如需下载请到原作者页面进行下载。