浏览代码

Upload: remove delete icon when disabled

Leopoldthecoder 8 年之前
父节点
当前提交
c8442ac3c9
共有 2 个文件被更改,包括 6 次插入0 次删除
  1. 1 0
      packages/upload/src/index.vue
  2. 5 0
      packages/upload/src/upload-list.vue

+ 1 - 0
packages/upload/src/index.vue

@@ -214,6 +214,7 @@ export default {
     if (this.showFileList) {
       uploadList = (
         <UploadList
+          disabled={this.disabled}
           listType={this.listType}
           files={this.uploadFiles}
           on-remove={this.handleRemove}

+ 5 - 0
packages/upload/src/upload-list.vue

@@ -40,6 +40,7 @@
           <i class="el-icon-view"></i>
         </span>
         <span
+          v-if="!disabled"
           class="el-upload-list__item-delete"
           @click="$emit('remove', file)"
         >
@@ -65,6 +66,10 @@
           return [];
         }
       },
+      disabled: {
+        type: Boolean,
+        default: false
+      },
       handlePreview: Function,
       listType: String
     },