From f4df58000f47950698b53c72b0a0feaa7573e1e3 Mon Sep 17 00:00:00 2001 From: lianyue Date: Wed, 30 May 2018 23:50:30 +0800 Subject: [PATCH] fix #196 --- package.json | 2 +- src/FileUpload.vue | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3c13332..63eeb91 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vue-upload-component", "description": "Vue.js file upload component, Multi-file upload, Upload directory, Drag upload, Drag the directory, Upload multiple files at the same time, html4 (IE 9), `PUT` method, Customize the filter", - "version": "2.8.7", + "version": "2.8.8", "author": "LianYue", "scripts": { "dev": "cross-env NODE_ENV=development webpack-dev-server", diff --git a/src/FileUpload.vue b/src/FileUpload.vue index 2bfd73a..b7af31c 100644 --- a/src/FileUpload.vue +++ b/src/FileUpload.vue @@ -487,8 +487,9 @@ export default { }) } } else { + var names = el.value.replace(/\\/g, '/').split('/') files.push({ - name: el.value.replace(/^.*?([^\/\\\r\n]+)$/, '$1'), + name: names[names.length - 1], el, }) }