'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

const index = require('./index-e1b469cd.js');

const indexCss = "taro-cover-image-core{overflow:hidden;width:320px;height:240px}";

const CoverImage = class {
  constructor(hostRef) {
    index.registerInstance(this, hostRef);
    this.onLoad = index.createEvent(this, "load", 7);
    this.onError = index.createEvent(this, "error", 7);
    this.src = undefined;
    this.nativeProps = {};
  }
  imageOnLoad() {
    const { width, height, } = this.imgRef;
    this.onLoad.emit({
      width,
      height
    });
  }
  imageOnError(e) {
    this.onError.emit(e);
  }
  render() {
    const { src, imageOnLoad, imageOnError, nativeProps } = this;
    return (index.h("img", Object.assign({ ref: img => (this.imgRef = img), src: src, onLoad: imageOnLoad.bind(this), onError: imageOnError.bind(this) }, nativeProps)));
  }
};
CoverImage.style = indexCss;

exports.taro_cover_image_core = CoverImage;

//# sourceMappingURL=taro-cover-image-core.cjs.entry.js.map