mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-23 18:00:27 +08:00
feat: 图表组件注册
This commit is contained in:
parent
ec5fccb945
commit
56d00831d3
@ -4,6 +4,7 @@ import router, { setupRouter } from '@/router'
|
|||||||
import i18n from '@/i18n/index'
|
import i18n from '@/i18n/index'
|
||||||
import { setupStore } from '@/store'
|
import { setupStore } from '@/store'
|
||||||
import { setupNaive, setupDirectives, setupCustomComponents } from '@/plugins'
|
import { setupNaive, setupDirectives, setupCustomComponents } from '@/plugins'
|
||||||
|
import { packagesInstall } from '@/packages/index'
|
||||||
import { AppProvider } from '@/components/AppProvider/index'
|
import { AppProvider } from '@/components/AppProvider/index'
|
||||||
import { setHtmlTheme } from '@/utils'
|
import { setHtmlTheme } from '@/utils'
|
||||||
|
|
||||||
@ -39,6 +40,9 @@ async function appInit() {
|
|||||||
// Store 准备就绪后处理主题色
|
// Store 准备就绪后处理主题色
|
||||||
setHtmlTheme()
|
setHtmlTheme()
|
||||||
|
|
||||||
|
// 注册 pakage 组件
|
||||||
|
app.use(packagesInstall)
|
||||||
|
|
||||||
// 语言注册
|
// 语言注册
|
||||||
app.use(i18n)
|
app.use(i18n)
|
||||||
|
|
||||||
|
@ -1,4 +1,9 @@
|
|||||||
import { PackagesCategoryEnum, PackagesType } from '@/packages/index.d'
|
import type { App } from 'vue'
|
||||||
|
import {
|
||||||
|
PackagesCategoryEnum,
|
||||||
|
PackagesType,
|
||||||
|
ConfigType
|
||||||
|
} from '@/packages/index.d'
|
||||||
import { ChartList } from '@/packages/components/Chart/index'
|
import { ChartList } from '@/packages/components/Chart/index'
|
||||||
import { DecorateList } from '@/packages/components/Decorate/index'
|
import { DecorateList } from '@/packages/components/Decorate/index'
|
||||||
import { InformationList } from '@/packages/components/Information/index'
|
import { InformationList } from '@/packages/components/Information/index'
|
||||||
@ -9,7 +14,17 @@ let packagesList: PackagesType = {
|
|||||||
[PackagesCategoryEnum.CHARTS]: ChartList,
|
[PackagesCategoryEnum.CHARTS]: ChartList,
|
||||||
[PackagesCategoryEnum.INFORMATION]: InformationList,
|
[PackagesCategoryEnum.INFORMATION]: InformationList,
|
||||||
[PackagesCategoryEnum.TABLES]: TableList,
|
[PackagesCategoryEnum.TABLES]: TableList,
|
||||||
[PackagesCategoryEnum.DECORATES]: DecorateList,
|
[PackagesCategoryEnum.DECORATES]: DecorateList
|
||||||
}
|
}
|
||||||
|
|
||||||
export { packagesList }
|
// 注册
|
||||||
|
const packagesInstall = (app: App): void => {
|
||||||
|
for (const item in packagesList) {
|
||||||
|
const chartList: ConfigType[] = (packagesList as any)[item]
|
||||||
|
chartList.forEach((chart: ConfigType) => {
|
||||||
|
app.component(chart.key, chart.node)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export { packagesList, packagesInstall }
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
<component :is="LayersIcon" />
|
<component :is="LayersIcon" />
|
||||||
</n-icon>
|
</n-icon>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- 图层内容 -->
|
||||||
</ContentBox>
|
</ContentBox>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user