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 c6b9a56b
authored
Aug 28, 2024
by
Li Kui
Committed by
GitHub
Aug 28, 2024
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: clearPreferencesAndLogout does not take effect when the preferences button …
…is at the top (#4253)
1 parent
6d243692
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
21 additions
and
7 deletions
packages/@core/ui-kit/layout-ui/src/vben-layout.vue
packages/effects/layouts/src/basic/header/header.vue
packages/effects/layouts/src/basic/layout.vue
packages/effects/layouts/src/widgets/preferences/preferences-button.vue
packages/effects/layouts/src/widgets/preferences/preferences-drawer.vue
packages/@core/ui-kit/layout-ui/src/vben-layout.vue
View file @
c6b9a56
...
@@ -184,9 +184,6 @@ const headerFixed = computed(() => {
...
@@ -184,9 +184,6 @@ const headerFixed = computed(() => {
});
});
const
showSidebar
=
computed
(()
=>
{
const
showSidebar
=
computed
(()
=>
{
// if (isMixedNav.value && !props.sideHidden) {
// return false;
// }
return
isSideMode
.
value
&&
sidebarEnable
.
value
;
return
isSideMode
.
value
&&
sidebarEnable
.
value
;
});
});
...
...
packages/effects/layouts/src/basic/header/header.vue
View file @
c6b9a56
...
@@ -27,6 +27,8 @@ withDefaults(defineProps<Props>(), {
...
@@ -27,6 +27,8 @@ withDefaults(defineProps<Props>(), {
theme
:
'light'
,
theme
:
'light'
,
});
});
const
emit
=
defineEmits
<
{
clearPreferencesAndLogout
:
[]
}
>
();
const
accessStore
=
useAccessStore
();
const
accessStore
=
useAccessStore
();
const
{
globalSearchShortcutKey
,
preferencesButtonPosition
}
=
usePreferences
();
const
{
globalSearchShortcutKey
,
preferencesButtonPosition
}
=
usePreferences
();
const
slots
=
useSlots
();
const
slots
=
useSlots
();
...
@@ -90,6 +92,10 @@ const leftSlots = computed(() => {
...
@@ -90,6 +92,10 @@ const leftSlots = computed(() => {
});
});
return
list
.
sort
((
a
,
b
)
=>
a
.
index
-
b
.
index
);
return
list
.
sort
((
a
,
b
)
=>
a
.
index
-
b
.
index
);
});
});
function
clearPreferencesAndLogout
()
{
emit
(
'clearPreferencesAndLogout'
);
}
</
script
>
</
script
>
<
template
>
<
template
>
...
@@ -123,7 +129,10 @@ const leftSlots = computed(() => {
...
@@ -123,7 +129,10 @@ const leftSlots = computed(() => {
</
template
>
</
template
>
<
template
v-else-if=
"slot.name === 'preferences'"
>
<
template
v-else-if=
"slot.name === 'preferences'"
>
<PreferencesButton
class=
"mr-2"
/>
<PreferencesButton
class=
"mr-2"
@
clear-preferences-and-logout=
"clearPreferencesAndLogout"
/>
</
template
>
</
template
>
<
template
v-else-if=
"slot.name === 'theme-toggle'"
>
<
template
v-else-if=
"slot.name === 'theme-toggle'"
>
<ThemeToggle
class=
"mr-2 mt-[2px]"
/>
<ThemeToggle
class=
"mr-2 mt-[2px]"
/>
...
...
packages/effects/layouts/src/basic/layout.vue
View file @
c6b9a56
...
@@ -202,7 +202,10 @@ const headerSlots = computed(() => {
...
@@ -202,7 +202,10 @@ const headerSlots = computed(() => {
</
template
>
</
template
>
<!-- 头部区域 -->
<!-- 头部区域 -->
<
template
#
header
>
<
template
#
header
>
<LayoutHeader
:theme=
"theme"
>
<LayoutHeader
:theme=
"theme"
@
clear-preferences-and-logout=
"clearPreferencesAndLogout"
>
<template
<template
v-if=
"!showHeaderNav && preferences.breadcrumb.enable"
v-if=
"!showHeaderNav && preferences.breadcrumb.enable"
#
breadcrumb
#
breadcrumb
...
...
packages/effects/layouts/src/widgets/preferences/preferences-button.vue
View file @
c6b9a56
...
@@ -3,9 +3,15 @@ import { Settings } from '@vben/icons';
...
@@ -3,9 +3,15 @@ import { Settings } from '@vben/icons';
import
{
VbenIconButton
}
from
'@vben-core/shadcn-ui'
;
import
{
VbenIconButton
}
from
'@vben-core/shadcn-ui'
;
import
Preferences
from
'./preferences.vue'
;
import
Preferences
from
'./preferences.vue'
;
const
emit
=
defineEmits
<
{
clearPreferencesAndLogout
:
[]
}
>
();
function
clearPreferencesAndLogout
()
{
emit
(
'clearPreferencesAndLogout'
);
}
</
script
>
</
script
>
<
template
>
<
template
>
<Preferences>
<Preferences
@
clear-preferences-and-logout=
"clearPreferencesAndLogout"
>
<VbenIconButton>
<VbenIconButton>
<Settings
class=
"size-4"
/>
<Settings
class=
"size-4"
/>
</VbenIconButton>
</VbenIconButton>
...
...
packages/effects/layouts/src/widgets/preferences/preferences-drawer.vue
View file @
c6b9a56
...
@@ -413,7 +413,6 @@ async function handleReset() {
...
@@ -413,7 +413,6 @@ async function handleReset() {
variant=
"ghost"
variant=
"ghost"
@
click=
"handleClearCache"
@
click=
"handleClearCache"
>
>
<!--
<RotateCw
class=
"mr-2 size-4"
/>
-->
{{
$t
(
'preferences.clearAndLogout'
)
}}
{{
$t
(
'preferences.clearAndLogout'
)
}}
</VbenButton>
</VbenButton>
</
template
>
</
template
>
...
...
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