From 0d3db253cad1fb49c4fae9b9a537c8c318c7172f Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期三, 29 十一月 2023 10:23:59 +0800 Subject: [PATCH] 优化应用中心卸载 --- src/components/subComponents/FileUpload/btn.vue | 40 ++++++++++++++++++++++------------------ 1 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/components/subComponents/FileUpload/btn.vue b/src/components/subComponents/FileUpload/btn.vue index 7ff2b0e..ca7ccc5 100644 --- a/src/components/subComponents/FileUpload/btn.vue +++ b/src/components/subComponents/FileUpload/btn.vue @@ -5,9 +5,9 @@ </template> <script> -import { uploaderMixin, supportMixin } from './common/mixins' +import { uploaderMixin, supportMixin } from "./common/mixins"; -const COMPONENT_NAME = 'uploader-btn' +const COMPONENT_NAME = "uploader-btn"; export default { name: COMPONENT_NAME, @@ -15,36 +15,40 @@ props: { directory: { type: Boolean, - default: false + default: false, }, single: { type: Boolean, - default: false + default: false, }, attrs: { type: Object, default() { - return {} - } + return {}; + }, }, sourceType: { type: Number, - } + }, }, - + mounted() { this.$nextTick(() => { - debugger - let props = {accept:''}; - if(this.sourceType == 1){ - props.accept = '.mp4'; - }else if(this.sourceType == 2){ - props.accept = '.jpg,.jpeg,.png'; + let props = { accept: "" }; + if (this.sourceType == 1) { + props.accept = ".mp4"; + } else if (this.sourceType == 2) { + props.accept = ".jpg,.jpeg,.png"; } - this.uploader.uploader.assignBrowse(this.$refs.btn, this.directory, this.single, props) - }) - } -} + this.uploader.uploader.assignBrowse( + this.$refs.btn, + this.directory, + this.single, + props + ); + }); + }, +}; </script> <style> -- Gitblit v1.8.0