import { createVNode as _createVNode } from "vue";
//@ts-nocheck
import { defineComponent } from "vue";
import IconFont from "./IconFont";
const MyIconFont = IconFont({
  scriptUrl: 'https://at.alicdn.com/t/font_2698224_pms5giiz6xn.js'
});
const Icon = defineComponent({
  name: 'x-icon',
  props: {
    type: String,
    spin: Boolean,
    color: String,
    size: [String, Number]
  },
  emits: ['click'],

  setup(props, {
    emit
  }) {
    function onClick(e) {
      emit('click', e);
    }

    return () => {
      const {
        spin
      } = props,
            prefixCls = 'x-icon';
      const cls = [prefixCls, {
        [`${prefixCls}-spin`]: spin
      }];
      const style = {
        fontSize: props.size + 'px',
        color: props.color
      };
      return _createVNode(MyIconFont, {
        "class": cls,
        "style": style,
        "type": props.type,
        "onClick": onClick
      }, null);
    };
  }

});

Icon.install = app => {
  app.component(Icon.name, Icon);
};

export default Icon;