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 3b0f7233
authored
Aug 13, 2024
by
Vben
Committed by
GitHub
Aug 13, 2024
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix: automatic hiding and displaying of headers can only be used on content (#4145)
1 parent
963e7906
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
10 deletions
docs/src/guide/essentials/route.md
packages/@core/ui-kit/layout-ui/src/vben-layout.vue
docs/src/guide/essentials/route.md
View file @
3b0f723
...
@@ -16,15 +16,15 @@ outline: deep
...
@@ -16,15 +16,15 @@ outline: deep
```
ts
```
ts
// 有需要可以自行打开注释,并创建文件夹
// 有需要可以自行打开注释,并创建文件夹
// const
staticRouteFiles = import.meta.glob('./static
/**/*.ts', { eager: true }); // [!code --]
// const
externalRouteFiles = import.meta.glob('./external
/**/*.ts', { eager: true }); // [!code --]
const
staticRouteFiles
=
import
.
meta
.
glob
(
'./static/**/*.ts'
,
{
eager
:
true
});
// [!code ++]
const
staticRouteFiles
=
import
.
meta
.
glob
(
'./static/**/*.ts'
,
{
eager
:
true
});
// [!code ++]
/** 动态路由 */
/** 动态路由 */
const
dynamicRoutes
:
RouteRecordRaw
[]
=
mergeRouteModules
(
dynamicRouteFiles
);
const
dynamicRoutes
:
RouteRecordRaw
[]
=
mergeRouteModules
(
dynamicRouteFiles
);
/**
静态路由列表,访问这些页面可以不需要权限
*/
/**
外部路由列表,访问这些页面可以不需要Layout,可能用于内嵌在别的系统
*/
// const
staticRoutes: RouteRecordRaw[] = mergeRouteModules(staticRouteFiles);
// [!code --]
// const
externalRoutes: RouteRecordRaw[] = mergeRouteModules(externalRouteFiles)
// [!code --]
const
static
Routes
:
RouteRecordRaw
[]
=
[];
// [!code --]
const
external
Routes
:
RouteRecordRaw
[]
=
[];
// [!code --]
const
staticRoutes
:
RouteRecordRaw
[]
=
mergeRouteModules
(
static
RouteFiles
);
// [!code ++]
const
externalRoutes
:
RouteRecordRaw
[]
=
mergeRouteModules
(
external
RouteFiles
);
// [!code ++]
```
```
### 动态路由
### 动态路由
...
...
packages/@core/ui-kit/layout-ui/src/vben-layout.vue
View file @
3b0f723
...
@@ -59,6 +59,11 @@ const sidebarExtraCollapse = defineModel<boolean>('sidebarExtraCollapse');
...
@@ -59,6 +59,11 @@ const sidebarExtraCollapse = defineModel<boolean>('sidebarExtraCollapse');
const
sidebarExpandOnHover
=
defineModel
<
boolean
>
(
'sidebarExpandOnHover'
);
const
sidebarExpandOnHover
=
defineModel
<
boolean
>
(
'sidebarExpandOnHover'
);
const
sidebarEnable
=
defineModel
<
boolean
>
(
'sidebarEnable'
,
{
default
:
true
});
const
sidebarEnable
=
defineModel
<
boolean
>
(
'sidebarEnable'
,
{
default
:
true
});
// side是否处于hover状态展开菜单中
const
sidebarExpandOnHovering
=
ref
(
false
);
const
headerIsHidden
=
ref
(
false
);
const
contentRef
=
ref
();
const
{
const
{
arrivedState
,
arrivedState
,
directions
,
directions
,
...
@@ -66,11 +71,7 @@ const {
...
@@ -66,11 +71,7 @@ const {
y
:
scrollY
,
y
:
scrollY
,
}
=
useScroll
(
document
);
}
=
useScroll
(
document
);
const
{
y
:
mouseY
}
=
useMouse
({
type
:
'client'
});
const
{
y
:
mouseY
}
=
useMouse
({
target
:
contentRef
,
type
:
'client'
});
// side是否处于hover状态展开菜单中
const
sidebarExpandOnHovering
=
ref
(
false
);
const
headerIsHidden
=
ref
(
false
);
const
realLayout
=
computed
(()
=>
const
realLayout
=
computed
(()
=>
props
.
isMobile
?
'sidebar-nav'
:
props
.
layout
,
props
.
isMobile
?
'sidebar-nav'
:
props
.
layout
,
...
@@ -507,6 +508,7 @@ function handleOpenMenu() {
...
@@ -507,6 +508,7 @@ function handleOpenMenu() {
</LayoutSidebar>
</LayoutSidebar>
<div
<div
ref=
"contentRef"
class=
"flex flex-1 flex-col overflow-hidden transition-all duration-300 ease-in"
class=
"flex flex-1 flex-col overflow-hidden transition-all duration-300 ease-in"
>
>
<div
<div
...
...
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