提交 e6dfeaf1 编写于 作者: D dolymood

feat(upload): file-click add index param

上级 99dc659e
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div class="cube-upload"> <div class="cube-upload">
<slot> <slot>
<div class="cube-upload-def clear-fix"> <div class="cube-upload-def clear-fix">
<upload-file v-for="(file, i) in files" :file="file" :key="i" @click="fileClick"></upload-file> <upload-file v-for="(file, i) in files" :file="file" :key="i" @click="fileClick(file, i)"></upload-file>
<upload-btn :multiple="multiple" :accept="accept" v-show="isShowBtn"></upload-btn> <upload-btn :multiple="multiple" :accept="accept" v-show="isShowBtn"></upload-btn>
</div> </div>
</slot> </slot>
...@@ -129,8 +129,8 @@ ...@@ -129,8 +129,8 @@
this.files.splice(index, 1) this.files.splice(index, 1)
this.upload() this.upload()
}, },
fileClick(file) { fileClick(file, index) {
this.$emit(EVENT_CLICK, file) this.$emit(EVENT_CLICK, file, index)
}, },
upload(retry) { upload(retry) {
const options = this.actionOptions const options = this.actionOptions
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册