Merge branch 'main' of github.com:DesignHhuang/vue-vben-admin
This commit is contained in:
commit
be6f89b4bf
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<ConfigProvider :locale="getAntdLocale">
|
<ConfigProvider :locale="getAntdLocale" :theme="isDark ? darkTheme : {}">
|
||||||
<AppProvider>
|
<AppProvider>
|
||||||
<RouterView />
|
<RouterView />
|
||||||
</AppProvider>
|
</AppProvider>
|
||||||
|
|
@ -11,11 +11,15 @@
|
||||||
import { AppProvider } from '@/components/Application';
|
import { AppProvider } from '@/components/Application';
|
||||||
import { useTitle } from '@/hooks/web/useTitle';
|
import { useTitle } from '@/hooks/web/useTitle';
|
||||||
import { useLocale } from '@/locales/useLocale';
|
import { useLocale } from '@/locales/useLocale';
|
||||||
|
|
||||||
import 'dayjs/locale/zh-cn';
|
import 'dayjs/locale/zh-cn';
|
||||||
|
import { useDarkModeTheme } from '@/hooks/setting/useDarkModeTheme';
|
||||||
|
|
||||||
// support Multi-language
|
// support Multi-language
|
||||||
const { getAntdLocale } = useLocale();
|
const { getAntdLocale } = useLocale();
|
||||||
|
|
||||||
|
const { isDark, darkTheme } = useDarkModeTheme();
|
||||||
|
|
||||||
// Listening to page changes and dynamically changing site titles
|
// Listening to page changes and dynamically changing site titles
|
||||||
useTitle();
|
useTitle();
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,10 @@
|
||||||
const joinLabel = Reflect.has(props.schema, 'rulesMessageJoinLabel')
|
const joinLabel = Reflect.has(props.schema, 'rulesMessageJoinLabel')
|
||||||
? rulesMessageJoinLabel
|
? rulesMessageJoinLabel
|
||||||
: globalRulesMessageJoinLabel;
|
: globalRulesMessageJoinLabel;
|
||||||
const defaultMsg = createPlaceholderMessage(component) + `${joinLabel ? label : ''}`;
|
const assertLabel = joinLabel ? label : '';
|
||||||
|
const defaultMsg = component
|
||||||
|
? createPlaceholderMessage(component) + assertLabel
|
||||||
|
: assertLabel;
|
||||||
|
|
||||||
function validator(rule: any, value: any) {
|
function validator(rule: any, value: any) {
|
||||||
const msg = rule.message || defaultMsg;
|
const msg = rule.message || defaultMsg;
|
||||||
|
|
@ -382,8 +385,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
const { colProps = {}, colSlot, renderColContent, component } = props.schema;
|
const { colProps = {}, colSlot, renderColContent, component, slot } = props.schema;
|
||||||
if (!componentMap.has(component)) {
|
if (!componentMap.has(component) && !slot) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@
|
||||||
&-close {
|
&-close {
|
||||||
width: auto !important;
|
width: auto !important;
|
||||||
outline: none;
|
outline: none;
|
||||||
background: #fff !important;
|
background: transparent !important;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
8265
src/design/dark.less
8265
src/design/dark.less
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,18 @@
|
||||||
|
import { computed } from 'vue';
|
||||||
|
import { theme } from 'ant-design-vue';
|
||||||
|
import { useRootSetting } from '/@/hooks/setting/useRootSetting';
|
||||||
|
import { ThemeEnum } from '/@/enums/appEnum';
|
||||||
|
|
||||||
|
export function useDarkModeTheme() {
|
||||||
|
const { getDarkMode } = useRootSetting();
|
||||||
|
const { darkAlgorithm } = theme;
|
||||||
|
const isDark = computed(() => getDarkMode.value === ThemeEnum.DARK);
|
||||||
|
const darkTheme = {
|
||||||
|
algorithm: [darkAlgorithm],
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
isDark,
|
||||||
|
darkTheme,
|
||||||
|
};
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue