From fa7044f3ccc9a91bc2bc117d1a06f650d86554f2 Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@iotlink.com> Date: 星期二, 15 六月 2021 16:07:16 +0800 Subject: [PATCH] 优化联动规则加载场景列表的操作 --- src/components/subComponents/FileUpload/btn.vue | 26 +++++++++++++------------- 1 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/subComponents/FileUpload/btn.vue b/src/components/subComponents/FileUpload/btn.vue index 45248b8..9eccf99 100644 --- a/src/components/subComponents/FileUpload/btn.vue +++ b/src/components/subComponents/FileUpload/btn.vue @@ -26,23 +26,23 @@ default() { return {} } + }, + sourceType: { + type: Number, } }, - watch:{ - attrs:{ - handler(n,o){ - debugger - this.$nextTick(()=>{ - this.uploader.uploader.assignBrowse(this.$refs.btn, this.directory, this.single, n) - }) - }, - deep: true - } - }, + mounted() { this.$nextTick(() => { - console.log('attrs',this.attrs) - this.uploader.uploader.assignBrowse(this.$refs.btn, this.directory, this.single, this.attrs) + console.log('btn attrs', this.attrs) + console.log("btn sourceType", this.sourceType) + 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) }) } } -- Gitblit v1.8.0