首页 > Web开发 > 详细

antd 上传图片获取宽高

时间:2021-02-01 21:48:28      阅读:221      评论:0      收藏:0      [点我收藏+]
    handleBeforeUpload (file, fileList) {
      return new Promise(async (resolve, reject) => {
        const imageReg = /\.(gif|jpg|jpeg|png|webp|GIF|JPG|JPEG|PNG|WEBP)$/
        this.getFileWidthAndHeight(file)
        console.log(‘handleBeforeUpload...‘, this.params, file)
        if (imageReg.test(file.name)) {
          return this.GetUploadSinature(this.params).then(() => resolve())
        }
        const errText = ‘请选择图片上传‘
        this.$message.error(errText)
        // eslint-disable-next-line prefer-promise-reject-errors
        reject()
      })
    },

 

antd 上传图片获取宽高

原文:https://www.cnblogs.com/dhjy123/p/14358879.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!