feat:新增全局接口配置,单个图表映射表,抽离柱状图数据格式,

This commit is contained in:
MTrun
2022-03-18 20:36:05 +08:00
parent 501dfdc223
commit c4ff0d24b7
20 changed files with 226 additions and 64 deletions
+9
View File
@@ -0,0 +1,9 @@
import hljs from 'highlight.js/lib/core'
import json from 'highlight.js/lib/languages/json'
import typescript from 'highlight.js/lib/languages/typescript'
export const useHook = () => {
hljs.registerLanguage('json', json)
hljs.registerLanguage('typescript', typescript)
return hljs
}
+2 -1
View File
@@ -1,2 +1,3 @@
export * from '@/hooks/theme.hook'
export * from '@/hooks/previewScale.hook'
export * from '@/hooks/previewScale.hook'
export * from '@/hooks/code.hook'
+4 -4
View File
@@ -7,10 +7,10 @@ import { toLight } from '@/utils'
/**
* 设置全局主题
*/
export const getThemeOverridesHook = () => {
export const useThemeOverridesHook = () => {
const designStore = useDesignStore()
const { getAppTheme } = toRefs(designStore)
const getDarkTheme = computed(
const darkTheme = computed(
(): GlobalThemeOverrides => {
// 通用
const commonObj = {
@@ -40,11 +40,11 @@ export const getThemeOverridesHook = () => {
return designStore.getDarkTheme ? dartObject : lightObject
}
)
return getDarkTheme
return darkTheme
}
// 返回暗黑主题
export const getDarkThemeHook = () => {
export const useDarkThemeHook = () => {
const designStore = useDesignStore()
return computed(() => (designStore.getDarkTheme ? darkTheme : undefined))
}