Commit 00acc379165a6fb61fdb80239ec2df3a4b7491d2
1 parent
511ff0f1
文件上传组件新增disabled属性
Showing
1 changed file
with
7 additions
and
1 deletions
ruoyi-ui/src/components/FileUpload/index.vue
... | ... | @@ -13,6 +13,7 @@ |
13 | 13 | :headers="headers" |
14 | 14 | class="upload-file-uploader" |
15 | 15 | ref="fileUpload" |
16 | + v-if="!disabled" | |
16 | 17 | > |
17 | 18 | <!-- 上传按钮 --> |
18 | 19 | <el-button size="mini" type="primary">选取文件</el-button> |
... | ... | @@ -32,7 +33,7 @@ |
32 | 33 | <span class="el-icon-document"> {{ getFileName(file.name) }} </span> |
33 | 34 | </el-link> |
34 | 35 | <div class="ele-upload-list__item-content-action"> |
35 | - <el-link :underline="false" @click="handleDelete(index)" type="danger">删除</el-link> | |
36 | + <el-link :underline="false" @click="handleDelete(index)" type="danger" v-if="!disabled">删除</el-link> | |
36 | 37 | </div> |
37 | 38 | </li> |
38 | 39 | </transition-group> |
... | ... | @@ -66,6 +67,11 @@ export default { |
66 | 67 | isShowTip: { |
67 | 68 | type: Boolean, |
68 | 69 | default: true |
70 | + }, | |
71 | + // 禁用组件(仅查看文件) | |
72 | + disabled: { | |
73 | + type: Boolean, | |
74 | + default: false | |
69 | 75 | } |
70 | 76 | }, |
71 | 77 | data() { |
... | ... |