var _components;

import Info from "../info";
import create from "../utils/create-basic";
import { addUnit } from "../utils/format/unit";
export default create({
  render: function render() {
    var _vm = this;

    var _h = _vm.$createElement;

    var _c = _vm._self._c || _h;

    return _c(_vm.tag, _vm._g({
      tag: "component",
      class: [_vm.classPrefix, _vm.isImage(_vm.name) ? '' : _vm.classPrefix + "-" + _vm.name],
      style: _vm.style
    }, _vm.$listeners), [_vm._t("default"), _vm.isImage(_vm.name) ? _c('img', {
      class: _vm.b('image'),
      attrs: {
        "src": _vm.name
      }
    }) : _vm._e(), _c('vm-info', {
      attrs: {
        "dot": _vm.dot,
        "info": _vm.badge || _vm.info
      }
    })], 2);
  },
  name: "icon",
  components: (_components = {}, _components[Info.name] = Info, _components),
  props: {
    dot: Boolean,
    badge: [Number, String],
    tag: {
      type: String,
      default: "i"
    },
    name: String,
    size: [String, Number],
    info: [String, Number],
    classPrefix: {
      type: String,
      default: "vm-icon"
    },
    color: {
      type: String
    }
  },
  methods: {
    isImage: function isImage(name) {
      return name ? name.indexOf("/") !== -1 : false;
    }
  },
  computed: {
    style: function style() {
      var size = this.size,
          color = this.color;
      var fontSize = addUnit(size);
      return {
        fontSize: fontSize,
        color: color
      };
    }
  }
});