Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Administrator
/
project_progress
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 61420317
authored
Nov 11, 2024
by
liangzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
暂存
1 parent
35d548fd
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
3 deletions
src/components/TagsView/ScrollPane.vue
src/components/TagsView/index.vue
src/components/event-bus.js
src/views/layout/continerView.vue
src/views/layout/mainLayout.vue
src/components/TagsView/ScrollPane.vue
View file @
6142031
<
template
>
<el-scrollbar
ref=
"scrollContainer"
:vertical=
"false"
class=
"scroll-container"
@
wheel
.
native
.
prevent=
"handleScroll"
>
<div
:class=
"openBar?'icon':'iconLeft'"
class=
"iconfont"
@
click=
"modifyStyle()"
>

</div>
<slot
/>
</el-scrollbar>
</
template
>
<
script
>
import
{
EventBus
}
from
"../event-bus.js"
;
const
tagAndTagSpacing
=
4
// tagAndTagSpacing
export
default
{
name
:
'ScrollPane'
,
data
()
{
return
{
left
:
0
left
:
0
,
openBar
:
true
,
}
},
computed
:
{
...
...
@@ -20,6 +25,15 @@ export default {
}
},
methods
:
{
modifyStyle
()
{
this
.
openBar
=!
this
.
openBar
if
(
!
this
.
openBar
){
EventBus
.
$emit
(
'modifyStyleEvent'
,
'new-style'
);
}
else
{
EventBus
.
$emit
(
'modifyStyleEvent'
,
'old-style'
);
}
},
handleScroll
(
e
)
{
const
eventDelta
=
e
.
wheelDelta
||
-
e
.
deltaY
*
40
const
$scrollWrapper
=
this
.
scrollWrapper
...
...
@@ -72,7 +86,37 @@ export default {
white-space
:
nowrap
;
position
:
relative
;
overflow
:
hidden
;
padding-left
:
100px
;
width
:
100%
;
.icon{
top
:
6px
;
width
:
48px
;
height
:
27px
;
line-height
:
27px
;
text-align
:
center
;
color
:
#edeaff
;
background-color
:
#63a4a6
;
border
:
1px
solid
#edf0f6
;
border-radius
:
5px
;
font-size
:
24px
;
position
:
absolute
;
left
:
0
;
transform
:
rotate
(
180deg
);
}
.iconLeft
{
top
:
6px
;
width
:
48px
;
height
:
27px
;
line-height
:
27px
;
text-align
:
center
;
color
:
#edeaff
;
background-color
:
#63a4a6
;
border
:
1px
solid
#edf0f6
;
border-radius
:
5px
;
font-size
:
24px
;
position
:
absolute
;
left
:
0
;
}
/
deep
/
{
.el-scrollbar__bar
{
bottom
:
0px
;
...
...
@@ -82,4 +126,13 @@ export default {
}
}
}
.fold-button
{
//
width
:
25px
;
//
height
:
20px
;
//
line-height
:
28px
;
//
text-align
:
center
;
//
font-size
:
14px
;
//
font-weight
:
600
;
}
</
style
>
src/components/TagsView/index.vue
View file @
6142031
...
...
@@ -235,6 +235,7 @@ export default {
<
style
lang=
"scss"
scoped
>
@import
'@/styles/common.scss'
;
/
deep
/
.scroll-container
.el-scrollbar__wrap
{
//
padding-left
:
50px
;
scrollbar-width
:
none
;
}
.hamburger-container
{
...
...
src/components/event-bus.js
0 → 100644
View file @
6142031
import
Vue
from
'vue'
export
const
EventBus
=
new
Vue
()
\ No newline at end of file
src/views/layout/continerView.vue
View file @
6142031
...
...
@@ -40,6 +40,8 @@ export default {
height
:
calc
(
100%
-
55px
);
position
:
relative
;
padding
:
15px
;
display
:
flex
;
flex-direction
:
column
;
}
</
style
>
\ No newline at end of file
src/views/layout/mainLayout.vue
View file @
6142031
<
template
>
<div
class=
"layout"
>
<LeftBar
class=
"bar
"
:authority=
"authority"
:autho=
"autho"
ref=
"child"
></LeftBar>
<LeftBar
:class=
"openBar?'bar':'barClose'
"
:authority=
"authority"
:autho=
"autho"
ref=
"child"
></LeftBar>
<ContinerView
class=
"continer"
id=
"myElement"
>
<router-view></router-view>
</ContinerView>
...
...
@@ -48,6 +48,7 @@
</template>
<
script
>
import
{
EventBus
}
from
"../../components/event-bus.js"
;
import
ContinerView
from
"./continerView"
;
import
LeftBar
from
"./leftBar"
;
...
...
@@ -58,6 +59,7 @@ export default {
},
data
()
{
return
{
openBar
:
true
,
title
:
"确认更改"
,
submenu
:
[
{
...
...
@@ -154,9 +156,16 @@ export default {
},
mounted
()
{
EventBus
.
$on
(
'modifyStyleEvent'
,
this
.
updateStyle
)
},
methods
:
{
updateStyle
(
style
)
{
console
.
log
(
'9999999'
)
this
.
openBar
=!
this
.
openBar
},
handleResize
()
{
// 处理窗口大小变化的逻辑
console
.
log
(
"Window was resized!"
);
...
...
@@ -195,6 +204,9 @@ export default {
}
},
beforeDestroy
()
{
EventBus
.
$off
(
'modifyStyleEvent'
,
this
.
updateStyle
);
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
...
...
@@ -208,7 +220,12 @@ export default {
position
:
relative
;
overflow
:
hidden
;
.bar
{
width
:
235px
!important
;
width
:
235px
;
height
:
100%
;
flex-shrink
:
0
;
}
.barClose
{
width
:
0
;
height
:
100%
;
flex-shrink
:
0
;
}
...
...
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