import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import "../../../src/scss/media-box.scss";
import Routeable from "../../../lib/mixins/routable";
import mixins from "../../../lib/utils/mixins";
export default mixins(Routeable
/* @vue/component */
).extend({
  name: 'w-media-box',
  props: {
    type: {
      type: String,
      default: 'appmsg'
    },
    thumb: String,
    title: String,
    description: String
  },
  methods: {
    onClick: function onClick() {
      this.$emit('click');
      this.routeLink();
    }
  },
  render: function render() {
    var _this = this;

    var h = arguments[0];

    var content = function content() {
      if (_this.type === 'appmsg') {
        return [h("div", {
          "class": "weui-media-box__hd"
        }, [h("img", {
          "class": "weui-media-box__thumb",
          "attrs": {
            "src": _this.thumb
          }
        })]), h("div", {
          "class": "weui-media-box__bd"
        }, [h("h4", {
          "class": "weui-media-box__title",
          "domProps": {
            "textContent": _this.title
          }
        }), h("p", {
          "class": "weui-media-box__desc",
          "domProps": {
            "textContent": _this.description
          }
        })])];
      } else {
        return [h("h4", {
          "class": "weui-media-box__title",
          "domProps": {
            "textContent": _this.title
          }
        }), h("p", {
          "class": "weui-media-box__desc",
          "domProps": {
            "textContent": _this.description
          }
        })];
      }
    };

    return h("div", {
      "class": _defineProperty({
        'weui-media-box': true
      }, 'weui-media-box_' + this.type, true),
      "on": {
        "click": function click() {
          _this.onClick();
        }
      }
    }, [content(), this.type !== 'appmsg' && this.$slots.box_ft]);
  }
});
//# sourceMappingURL=WMediaBox.js.map