按照比列缩小


      var w = cliW.clientWidth || cliW.offsetWidth;

      // 当图片比图片框小时不做任何改变
      if (_this.$refs.imgShow.width > w) {
        _this.rate = w / _this.$refs.imgShow.width;
        _this.$refs.imgShow.width = w;
        _this.$refs.imgShow.height =
          (w * _this.$refs.imgShow.height) / _this.$refs.imgShow.width;
      }
posted @ 2022-08-04 16:36  诡道也  阅读(10)  评论(0编辑  收藏  举报