概述
在packages/core目录下对开发的组件进行导入和导出,供其他用户(开发者)使用。
详情
- packages/core/components.ts
// 从vue包中导入插件类型
import type { Plugin } from 'vue'
// 从组件包中导入按钮组件
import { LxxButton } from '@lxx-ui/components'
// 默认导出组件集合
export default [LxxButton] as Plugin[]
- packages/core/index.ts
// 从工具包中导入安装器
import { makeInstaller } from '@lxx-ui/utils'
// 从组件文件中导入组件集合
import components from './components'
// 从样式主题包中导入样式
import '@lxx-ui/theme/index.css'
// 使用安装器注册所有组件
const installer = makeInstaller(components)
// 分别导出,使用时可以按需导入并注册
export * from '@lxx-ui/components'
// 默认导出,使用时就将所有组件都注册
export default installer