deotalandAi/packages/ui/src/plugins-integration.js

49 lines
935 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 导入主UI组件
import DtButton from './components/Button.vue'
import DtModal from './components/Modal.vue'
import DtInput from './components/Input.vue'
// 导入插件组件
import { ChartPlugin } from './plugins/charts/index.js'
import { EditorPlugin } from './plugins/editor/index.js'
// 组件列表
const components = [
DtButton,
DtModal,
DtInput,
ChartPlugin,
EditorPlugin
]
// 插件列表
const plugins = {
ChartPlugin,
EditorPlugin
}
// 批量注册函数
export function installUI(app) {
components.forEach(component => {
if (component && typeof component === 'object') {
app.component(component.name || component.__name, component)
}
})
// 注册插件到全局
app.config.globalProperties.$uiPlugins = plugins
}
// 默认导出
export {
DtButton,
DtModal,
DtInput,
ChartPlugin,
EditorPlugin
}
// 安装函数Vue插件
export default {
install: installUI
}