| | |
| | | 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) |
| | | }) |
| | | } |
| | | } |