49 lines
935 B
JavaScript
49 lines
935 B
JavaScript
// 导入主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
|
||
} |