Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
monorepo
/
venus
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
1
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 65ba45fd
authored
Jun 22, 2024
by
vben
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: antdesign dark not work
1 parent
a06c8f03
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
apps/web-antd/src/app.vue
apps/web-antd/src/views/_essential/authentication/login.vue
packages/@core/shared/design/src/scss/common/base.scss
apps/web-antd/src/app.vue
View file @
65ba45f
...
@@ -4,7 +4,7 @@ import { computed } from 'vue';
...
@@ -4,7 +4,7 @@ import { computed } from 'vue';
import
{
GlobalProvider
}
from
'@vben/universal-ui'
;
import
{
GlobalProvider
}
from
'@vben/universal-ui'
;
import
{
preferences
,
usePreferences
}
from
'@vben-core/preferences'
;
import
{
preferences
,
usePreferences
}
from
'@vben-core/preferences'
;
import
{
ConfigProvider
,
theme
}
from
'ant-design-vue'
;
import
{
App
,
ConfigProvider
,
theme
}
from
'ant-design-vue'
;
import
zhCN
from
'ant-design-vue/es/locale/zh_CN'
;
import
zhCN
from
'ant-design-vue/es/locale/zh_CN'
;
import
dayjs
from
'dayjs'
;
import
dayjs
from
'dayjs'
;
...
@@ -17,16 +17,17 @@ dayjs.locale(zhCN.locale);
...
@@ -17,16 +17,17 @@ dayjs.locale(zhCN.locale);
const
{
isDark
}
=
usePreferences
();
const
{
isDark
}
=
usePreferences
();
const
tokenTheme
=
computed
(()
=>
{
const
tokenTheme
=
computed
(()
=>
{
const
algorithm
s
=
isDark
.
value
const
algorithm
=
isDark
.
value
?
[
theme
.
darkAlgorithm
]
?
[
theme
.
darkAlgorithm
]
:
[
theme
.
defaultAlgorithm
];
:
[
theme
.
defaultAlgorithm
];
// antd 紧凑模式算法
// antd 紧凑模式算法
if
(
preferences
.
app
.
compact
)
{
if
(
preferences
.
app
.
compact
)
{
algorithm
s
.
push
(
theme
.
compactAlgorithm
);
algorithm
.
push
(
theme
.
compactAlgorithm
);
}
}
return
{
return
{
algorithm
s
,
algorithm
,
token
:
{
colorPrimary
:
preferences
.
theme
.
colorPrimary
},
token
:
{
colorPrimary
:
preferences
.
theme
.
colorPrimary
},
};
};
});
});
...
@@ -35,7 +36,9 @@ const tokenTheme = computed(() => {
...
@@ -35,7 +36,9 @@ const tokenTheme = computed(() => {
<
template
>
<
template
>
<GlobalProvider>
<GlobalProvider>
<ConfigProvider
:locale=
"zhCN"
:theme=
"tokenTheme"
>
<ConfigProvider
:locale=
"zhCN"
:theme=
"tokenTheme"
>
<App>
<RouterView
/>
<RouterView
/>
</App>
</ConfigProvider>
</ConfigProvider>
</GlobalProvider>
</GlobalProvider>
</
template
>
</
template
>
apps/web-antd/src/views/_essential/authentication/login.vue
View file @
65ba45f
...
@@ -9,7 +9,7 @@ import { AuthenticationLogin } from '@vben/universal-ui';
...
@@ -9,7 +9,7 @@ import { AuthenticationLogin } from '@vben/universal-ui';
import
{
useRequest
}
from
'@vben-core/request'
;
import
{
useRequest
}
from
'@vben-core/request'
;
import
{
useAccessStore
}
from
'@vben-core/stores'
;
import
{
useAccessStore
}
from
'@vben-core/stores'
;
import
{
notification
}
from
'ant-design-vue'
;
import
{
App
}
from
'ant-design-vue'
;
import
{
getUserInfo
,
userLogin
}
from
'#/apis'
;
import
{
getUserInfo
,
userLogin
}
from
'#/apis'
;
...
@@ -17,6 +17,7 @@ defineOptions({ name: 'Login' });
...
@@ -17,6 +17,7 @@ defineOptions({ name: 'Login' });
const
router
=
useRouter
();
const
router
=
useRouter
();
const
accessStore
=
useAccessStore
();
const
accessStore
=
useAccessStore
();
const
{
notification
}
=
App
.
useApp
();
const
{
loading
,
runAsync
:
runUserLogin
}
=
useRequest
(
userLogin
,
{
const
{
loading
,
runAsync
:
runUserLogin
}
=
useRequest
(
userLogin
,
{
manual
:
true
,
manual
:
true
,
...
...
packages/@core/shared/design/src/scss/common/base.scss
View file @
65ba45f
...
@@ -7,6 +7,10 @@ html {
...
@@ -7,6 +7,10 @@ html {
overscroll-behavior
:
none
;
overscroll-behavior
:
none
;
}
}
.ant-app
{
color
:
inherit
;
}
*,
*,
:
:
after
,
:
:
after
,
::
before
{
::
before
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment