componentRegister.ts 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. interface ComBase {
  2. name: string;
  3. component: Function;
  4. }
  5. const comps: Array<ComBase> = [
  6. {
  7. name: "byForm",
  8. component: () => import("@/benyun/components/byForm/byForm.vue"),
  9. },
  10. {
  11. name: "byInput",
  12. component: () => import("@/benyun/components/byInput/byInput.vue"),
  13. },
  14. {
  15. name: "bySelect",
  16. component: () => import("@/benyun/components/bySelect/bySelect.vue"),
  17. },
  18. {
  19. name: "byDatePicker",
  20. component: () => import("@/benyun/components/byDatePicker/byDatePicker.vue"),
  21. },
  22. {
  23. name: "byTable",
  24. component: () => import("@/benyun/components/byTable/byTable.vue"),
  25. },
  26. {
  27. name: "byTool",
  28. component: () => import("@/benyun/components/byTool/byTool.vue"),
  29. },
  30. {
  31. name: "moduleView",
  32. component: () => import("@/benyun/components/moduleView/moduleView.vue"),
  33. },
  34. {
  35. name: "byBill",
  36. component: () => import("@/benyun/components/byBill/byBill.vue"),
  37. },
  38. {
  39. name: "selectTree",
  40. component: () => import("@/benyun/components/selectTree/selectTree.vue"),
  41. },
  42. {
  43. name: "byArea",
  44. component: () => import("@/benyun/components/byArea/byArea.vue"),
  45. },
  46. {
  47. name: "sideTree",
  48. component: () => import("@/benyun/components/sideTree/sideTree.vue"),
  49. },
  50. {
  51. name: "bySwitch",
  52. component: () => import("@/benyun/components/bySwitch/bySwitch.vue"),
  53. },
  54. {
  55. name: "columnarChart",
  56. component: () => import("@/benyun/components/chart/columnarChart.vue"),
  57. },
  58. {
  59. name: "lineChart",
  60. component: () => import("@/benyun/components/chart/lineChart.vue"),
  61. },
  62. {
  63. name: "pieChart",
  64. component: () => import("@/benyun/components/chart/pieChart.vue"),
  65. },
  66. ];
  67. const install = function (Vue: any) {
  68. comps.forEach((item) => {
  69. Vue.component(item.name, item.component);
  70. });
  71. if (typeof window !== "undefined" && window.Vue) {
  72. install(window.Vue);
  73. }
  74. };
  75. export default install;