const comps=[{
  name:'byTable',
  component:() => import('@/benyun/components/byTable/byTable.vue')
},{
  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:'byDate',
  component:() => import('@/benyun/components/byDate/byDate.vue')
},{
  name:'byTool',
  component:() => import('@/benyun/components/byTool/byTool.vue')
},{
  name:'moduleView',
  component:() => import('@/benyun/components/moduleView/moduleView.vue')
},{
  name:'byArea',
  component:() => import('@/benyun/components/byArea/byArea.vue')
},{
  name:'textChange',
  component:() => import('@/benyun/components/textChange/textChange.vue')
}]

// // 定义组件名对象
const install = {
  // install是默认的方法。当外界在use这个组件的时候
  install: function (Vue) {

    //top组件，里面的数据不是以前的对象，在组件的时候。
    comps.forEach((item) => {
      Vue.component(item.name, defineAsyncComponent(item.component));
    })
  }
}

// const install = function (app) {
//   comps.forEach((item) => {
//     app.component(item.name, item.component);
//   });
// };

export default install;