From 345cd7744ccec66e8871ebf366e1c93feedfc784 Mon Sep 17 00:00:00 2001 From: "jinlan.du" Date: Wed, 20 May 2020 15:11:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=AD=E7=82=B9=E7=BB=AD=E4=BC=A0input?= =?UTF-8?q?=E9=9A=90=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../view/example/breakpoint/breakpoint.vue | 45 +++++++++---------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/web/src/view/example/breakpoint/breakpoint.vue b/web/src/view/example/breakpoint/breakpoint.vue index 67373db1..a297f305 100644 --- a/web/src/view/example/breakpoint/breakpoint.vue +++ b/web/src/view/example/breakpoint/breakpoint.vue @@ -2,24 +2,24 @@
大文件上传
-
- 选择文件 +
+ 选择文件 +
上传文件
请上传不超过5MB的文件
- -
+ +
- {{ item.name }} - {{percentage}}% + {{ file.name }} + {{percentage}}%
- +
- -
此版本为先行体验功能测试版,样式美化和性能优化正在进行中,上传切片文件和合成的完整文件分别再QMPlusserver目录的breakpointDir文件夹和fileDir文件夹
@@ -45,8 +45,7 @@ export default { limitFileSize: false, percentage:0, percentageFlage: true, - customColor: '#409eff', - uploadList:[] + customColor: '#409eff' } }, created(){ @@ -59,6 +58,7 @@ export default { const file = e.target.files[0] // 获取当前文件 const maxSize = 5*1024*1024 this.file = file // file 丢全局方便后面用 可以改进为func传参形式 + this.percentage = 0 if(file.size { @@ -123,9 +123,6 @@ export default { this.percentageFlage = false } this.sliceFile() // 上传切片 - if(this.percentage == 100){ - this.uploadList.push(this.file) - } }, sliceFile() { this.waitUpLoad && @@ -164,6 +161,9 @@ export default { await removeChunk(params) } } + }, + inputChange(){ + this.$refs.Input.dispatchEvent(new MouseEvent('click')) } } } @@ -198,15 +198,14 @@ a { border-radius: 4px; overflow: hidden; display: inline-block; - input{ - position: absolute; - font-size: 100px; - right: 0; - top: 0; - opacity: 0; - cursor: pointer; - } - + input{ + position: absolute; + font-size: 100px; + right: 0; + top: 0; + opacity: 0; + cursor: pointer; + } } .fileName{ display: inline-block;