interface ComBase {
  name: string;
  component: Function;
}
const comps: Array<ComBase> = [
  {
    name: "byForm",
    component: () => import("@/benyun/components/byForm/byForm.vue"),
  },
  {
    name: "byInput",
    component: () => import("@/benyun/components/byInput/byInput.vue"),
  },
  {
    name: "bySelect",
    component: () => import("@/benyun/components/bySelect/bySelect.vue"),
  },
  {
    name: "byDatePicker",
    component: () => import("@/benyun/components/byDatePicker/byDatePicker.vue"),
  },
  {
    name: "byTable",
    component: () => import("@/benyun/components/byTable/byTable.vue"),
  },
  {
    name: "byTool",
    component: () => import("@/benyun/components/byTool/byTool.vue"),
  },
  {
    name: "moduleView",
    component: () => import("@/benyun/components/moduleView/moduleView.vue"),
  },
  {
    name: "byBill",
    component: () => import("@/benyun/components/byBill/byBill.vue"),
  },
  {
    name: "selectTree",
    component: () => import("@/benyun/components/selectTree/selectTree.vue"),
  },
  {
    name: "byArea",
    component: () => import("@/benyun/components/byArea/byArea.vue"),
  },
  {
    name: "sideTree",
    component: () => import("@/benyun/components/sideTree/sideTree.vue"),
  },
  {
    name: "bySwitch",
    component: () => import("@/benyun/components/bySwitch/bySwitch.vue"),
  },
  {
    name: "textChange",
    component: () => import("@/benyun/components/textChange/textChange.vue"),
  },
  // {
  //   name: "byMonacoEditor",
  //   component: () => import("@/benyun/components/byMonacoEditor/byMonacoEditor.vue"),
  // },
];

const install = function (Vue: any) {
  comps.forEach((item) => {
    Vue.component(item.name, item.component);
  });

  if (typeof window !== "undefined" && window.Vue) {
    install(window.Vue);
  }
};

export default install;
