diff --git a/bs-ui/src/components/FileUpload/index.vue b/bs-ui/src/components/FileUpload/index.vue index 8df7012..8bcba9e 100644 --- a/bs-ui/src/components/FileUpload/index.vue +++ b/bs-ui/src/components/FileUpload/index.vue @@ -9,24 +9,32 @@ :on-error="handleUploadError" :on-exceed="handleExceed" :on-success="handleUploadSuccess" - :show-file-list="false" + :show-file-list="imageOnly" :headers="headers" + :on-remove="handleRemove" + :list-type="imageOnly?'picture-card':'text'" class="upload-file-uploader" ref="fileUpload" > - - 选取文件 - + + + - +
  • {{ getFileName(file.oldName) }} @@ -66,6 +74,10 @@ export default { isShowTip: { type: Boolean, default: true + }, + imageOnly: { + type: Boolean, + default: false, } }, data() { @@ -161,6 +173,10 @@ export default { this.uploadedSuccessfully(); } }, + handleRemove(file) { + this.fileList = this.fileList.filter(item => item !== file); + this.$emit("input", this.fileList); + }, // 删除文件 handleDelete(index) { this.fileList.splice(index, 1); diff --git a/bs-ui/src/layout/components/Navbar.vue b/bs-ui/src/layout/components/Navbar.vue index 62a50c7..6a9d4da 100644 --- a/bs-ui/src/layout/components/Navbar.vue +++ b/bs-ui/src/layout/components/Navbar.vue @@ -5,7 +5,9 @@ - +