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, }) }