v-uploader - 基于 Vue2 简洁易用,可批量、拖拽的文件上传插件

1,107 阅读1分钟

v-uploader

基于 Vue2 简洁易用,可批量、拖拽的文件上传插件


Demo、文档

请浏览


插件预览

单文件上传带图片预览模式

single

批量上传,支持拖拽模式

multiple



插件安装

npm i v-uploader --save

在项目入口文件 main.js 中引用插件

import Vue from 'vue'
import vUploader from 'v-uploader';

/**
 * v-uploader plugin global config
 */
const uploaderConfig = {
    uploadFileUrl: 'http://xxx/upload',
    deleteFileUrl: 'http://xxx/delete',
    showMessage: (vue, message) => {
        //using v-dialogs to show message
        vue.$vDialog.alert(message, null, {messageType: 'error'});
    }
};

//install plugin with options
Vue.use(vUploader, uploaderConfig);