heyujie
2021-10-11 ae2d855c89ca722ac7309fdf1aa6ceed370e3b95
src/components/subComponents/FileUpload/btn.vue
@@ -27,22 +27,20 @@
        return {}
      }
    },
  },
  watch: {
    attrs: {
      handler(n, o) {
        //this.$nextTick(() => {
          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)
    })
  }
}
@@ -63,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>