From 1e09a7a01a6c1888e1a2a832eb007fb8c2b653a0 Mon Sep 17 00:00:00 2001 From: ZZJ <zzjdsg2300@163.com> Date: 星期三, 26 一月 2022 11:06:27 +0800 Subject: [PATCH] Merge branch 'bhomebus' of http://192.168.5.5:10010/r/web/vue-smart-ai into bhomebus --- src/components/subComponents/FileUpload/btn.vue | 27 +++++++++++---------------- 1 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/components/subComponents/FileUpload/btn.vue b/src/components/subComponents/FileUpload/btn.vue index 750ad79..0bffa02 100644 --- a/src/components/subComponents/FileUpload/btn.vue +++ b/src/components/subComponents/FileUpload/btn.vue @@ -27,25 +27,20 @@ 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) + 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) }) } } @@ -66,6 +61,6 @@ outline: none; } .uploader-btn:hover { - background-color: rgba(0, 0, 0, 0.08); + /* background-color: rgba(0, 0, 0, 0.08); */ } </style> -- Gitblit v1.8.0