• vue获取图片宽高


     uploadFile(event){
            let that = this;
            let file = event.target.files[0];
            let fileReader = new FileReader();
            fileReader.readAsDataURL(file); //根据图片路径读取图片
            fileReader.onload = function(e) {
              let base64 = this.result;
              let img = new Image();
              img.src = base64;
              img.onload = function() {
                that.imgInfo = {
                   img.naturalWidth,
                  height: img.naturalHeight
                };
                console.log("宽:" + img.naturalWidth + " 高:" + img.naturalHeight);
              }
            }
          },
    正道的光终将来临,当太阳升起的时候,光芒总会普照大地温暖人间。些许的阴霾也终会有被阳光洒满的一天
  • 相关阅读:
    QT中的列表容器
    QT中的Buttons
    QT中的常用控件
    [机房测试]弟娃
    CF1580C Train Maintenance
    [机房测试]数据恢复
    Sentry 监控
    Sentry 监控
    Sentry 监控
    Sentry 后端监控
  • 原文地址:https://www.cnblogs.com/sjruxe/p/14007265.html
Copyright © 2020-2023  润新知