import BaseTool from './tool'
import DictCache from './dict'
import { GlobalConstant, Constant } from '@/constant'
import Badge from '@/components/custom/Badge'
import RowList from '@/components/custom/RowList'
import EditableCell from '@/components/custom/EditableCell'
import SumCol from '@/components/custom/SumCol'
import TitleDivider from '@/components/custom/TitleDivider'
import ImgCode from '@/components/custom/ImgCode'
import QTabs from '@/components/custom/QTabs'
import QTabPane from '@/components/custom/QTabPane'
import OperationButton from '@/components/custom/OperationButton'
import QRCode from '@/components/custom/QRCode'
import CityCascader from '@/components/custom/CityCascader'
import UploadImageDetail from '@/components/custom/UploadImageDetail'
import { Icon } from 'ant-design-vue'
import iconfont from '@/components/IconSelector/iconfont.js'
import ImportForm from '@/components/custom/ImportForm'
const MyIcon = Icon.createFromIconfontCN({
  scriptUrl: iconfont // //at.alicdn.com/t/font_1314041_9qgpnn1vvko.js在 iconfont.cn 上生成
})

export default {
  // Vue.js的插件应当有一个公开方法 install。这个方法的第一个参数是 Vue 构造器，第二个参数是一个可选的选项对象。
  vm: {},
  install: function (Vue) {
    Vue.prototype.BaseTool = BaseTool
    Vue.prototype.DictCache = DictCache
    Vue.prototype.MyGlobalConstant = GlobalConstant
    Vue.prototype.MyConstant = Constant
    Vue.component(Badge.name, Badge)
    Vue.component(RowList.name, RowList)
    Vue.component('RowItem', RowList.Item)
    Vue.component(EditableCell.name, EditableCell)
    Vue.component(SumCol.name, SumCol)
    Vue.component(TitleDivider.name, TitleDivider)
    Vue.component(ImgCode.name, ImgCode)
    Vue.component(QRCode.name, ImgCode)
    Vue.component(QTabs.name, QTabs)
    Vue.component(QTabPane.name, QTabPane)
    Vue.component(OperationButton.name, OperationButton)
    Vue.component(CityCascader.name, CityCascader)
    Vue.component(UploadImageDetail.name, UploadImageDetail)
    Vue.component(ImportForm.name, ImportForm)
    Vue.component('my-icon', MyIcon)
  }
}
