Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
1e5fcd2c
Commit
1e5fcd2c
authored
Jan 06, 2021
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: added mixSide trigger
parent
0e7c57bd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
12 deletions
+43
-12
useMenuSetting.ts
src/hooks/setting/useMenuSetting.ts
+4
-2
MixSider.vue
src/layouts/default/sider/MixSider.vue
+39
-10
No files found.
src/hooks/setting/useMenuSetting.ts
View file @
1e5fcd2c
...
...
@@ -93,8 +93,10 @@ const getCalcContentWidth = computed(() => {
unref
(
getIsTopMenu
)
||
!
unref
(
getShowMenu
)
||
(
unref
(
getSplit
)
&&
unref
(
getMenuHidden
))
?
0
:
unref
(
getIsMixSidebar
)
?
SIDE_BAR_SHOW_TIT_MINI_WIDTH
+
(
unref
(
getMixSideFixed
)
&&
unref
(
mixSideHasChildren
)
?
unref
(
getRealWidth
)
:
0
)
?
unref
(
getCollapsed
)
?
SIDE_BAR_MINI_WIDTH
:
SIDE_BAR_SHOW_TIT_MINI_WIDTH
+
(
unref
(
getMixSideFixed
)
&&
unref
(
mixSideHasChildren
)
?
unref
(
getRealWidth
)
:
0
)
:
unref
(
getRealWidth
);
return
`calc(100% -
${
unref
(
width
)}
px)`
;
});
...
...
src/layouts/default/sider/MixSider.vue
View file @
1e5fcd2c
...
...
@@ -15,6 +15,9 @@
v-bind="getMenuEvents"
>
<AppLogo
:showTitle=
"false"
:class=
"`$
{prefixCls}-logo`" />
<Trigger
:class=
"`$
{prefixCls}-trigger`" />
<ScrollContainer>
<ul
:class=
"`$
{prefixCls}-module`">
<li
...
...
@@ -76,25 +79,30 @@
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
onMounted
,
ref
,
computed
,
CSSProperties
,
unref
}
from
'
vue
'
;
import
type
{
Menu
}
from
'
/@/router/types
'
;
import
{
RouteLocationNormalized
}
from
'
vue-router
'
;
import
{
useDesign
}
from
'
/@/hooks/web/useDesign
'
;
import
{
getShallowMenus
,
getChildrenMenus
,
getCurrentParentPath
}
from
'
/@/router/menus
'
;
import
{
useI18n
}
from
'
/@/hooks/web/useI18n
'
;
import
type
{
CSSProperties
}
from
'
vue
'
;
import
type
{
RouteLocationNormalized
}
from
'
vue-router
'
;
import
{
defineComponent
,
onMounted
,
ref
,
computed
,
unref
}
from
'
vue
'
;
import
{
BasicMenu
,
MenuTag
}
from
'
/@/components/Menu
'
;
import
{
ScrollContainer
}
from
'
/@/components/Container
'
;
import
Icon
from
'
/@/components/Icon
'
;
import
{
AppLogo
}
from
'
/@/components/Application
'
;
import
{
useGo
}
from
'
/@/hooks/web/usePage
'
;
import
{
BasicMenu
,
MenuTag
}
from
'
/@/components/Menu
'
;
import
{
listenerLastChangeTab
}
from
'
/@/logics/mitt/tabChange
'
;
import
Trigger
from
'
../trigger/HeaderTrigger.vue
'
;
import
{
useMenuSetting
}
from
'
/@/hooks/setting/useMenuSetting
'
;
import
{
useDragLine
}
from
'
./useLayoutSider
'
;
import
{
useGlobSetting
}
from
'
/@/hooks/setting
'
;
import
{
useDesign
}
from
'
/@/hooks/web/useDesign
'
;
import
{
useI18n
}
from
'
/@/hooks/web/useI18n
'
;
import
{
useGo
}
from
'
/@/hooks/web/usePage
'
;
import
{
SIDE_BAR_SHOW_TIT_MINI_WIDTH
,
SIDE_BAR_MINI_WIDTH
}
from
'
/@/enums/appEnum
'
;
import
clickOutside
from
'
/@/directives/clickOutside
'
;
import
{
getShallowMenus
,
getChildrenMenus
,
getCurrentParentPath
}
from
'
/@/router/menus
'
;
import
{
listenerLastChangeTab
}
from
'
/@/logics/mitt/tabChange
'
;
export
default
defineComponent
({
name
:
'
LayoutMixSider
'
,
...
...
@@ -104,6 +112,7 @@
BasicMenu
,
MenuTag
,
Icon
,
Trigger
,
},
directives
:
{
clickOutside
,
...
...
@@ -419,7 +428,7 @@
}
> .scrollbar {
height: calc(100% - @header-height
) !important
;
height: calc(100% - @header-height
- 38px)
;
}
&.mini &-module {
...
...
@@ -468,14 +477,34 @@
&__icon {
margin-bottom: 8px;
font-size: 24px;
transition: all 0.2s;
}
&__name {
margin-bottom: 0;
font-size: 12px;
transition: all 0.2s;
}
}
&-trigger {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
padding: 6px;
padding-left: 12px;
font-size: 18px;
color: rgba(255, 255, 255, 0.65);
cursor: pointer;
background: @sider-dark-bg-color;
}
&.light &-trigger {
color: rgba(0, 0, 0, 0.65);
background: #fff;
}
&-menu-list {
position: fixed;
top: 0;
...
...
@@ -483,7 +512,7 @@
width: 200px;
height: calc(100%);
background: #fff;
transition:
width
0.2s;
transition:
all
0.2s;
.@{tag-prefix-cls} {
position: absolute;
top: 10px;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment