From 85da22c4861736f7b0cabbc75daecbe4fea1bf80 Mon Sep 17 00:00:00 2001 From: heyujie <516346543@qq.com> Date: 星期日, 04 七月 2021 21:01:12 +0800 Subject: [PATCH] 周天更改 --- src/components/subComponents/FileUpload/btn.vue | 27 ++++++++++++--------------- 1 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/components/subComponents/FileUpload/btn.vue b/src/components/subComponents/FileUpload/btn.vue index 750ad79..9eccf99 100644 --- a/src/components/subComponents/FileUpload/btn.vue +++ b/src/components/subComponents/FileUpload/btn.vue @@ -27,25 +27,22 @@ return {} } }, - - }, - watch: { - attrs: { - handler(n, o) { - //this.$nextTick(() => { - if(n){ - this.uploader.uploader.assignBrowse(this.$refs.btn, this.directory, this.single, n) - } - - //}) - }, - deep: true + sourceType: { + type: Number, } }, + 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