Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
components
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tracing
components
Commits
9391114b
Commit
9391114b
authored
Mar 08, 2022
by
chenqikuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设置公共参数
parent
731240ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
index.vue
src/components/src/SideBar/index.vue
+5
-5
SideBar.stories.ts
src/stories/SideBar.stories.ts
+7
-4
No files found.
src/components/src/SideBar/index.vue
View file @
9391114b
...
@@ -13,10 +13,10 @@
...
@@ -13,10 +13,10 @@
v-for=
"(menu, i) in menuList"
v-for=
"(menu, i) in menuList"
:key=
"i"
:key=
"i"
:class=
"
{
:class=
"
{
'bg-mGray5 ': current
Route
=== i,
'bg-mGray5 ': current === i,
'!mt-20': i === 0,
'!mt-20': i === 0,
}"
}"
@click="select
Page
&&
selectPage
(i)"
@click="select
Current
&&
selectCurrent
(i)"
>
>
<div
class=
"box-content"
style=
"padding: 14px 0 5px 0;"
>
<div
class=
"box-content"
style=
"padding: 14px 0 5px 0;"
>
<i
class=
"iconfont text-sm"
v-html=
"menu.icon"
></i>
<i
class=
"iconfont text-sm"
v-html=
"menu.icon"
></i>
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
<div
<div
class=
"hidden absolute top-0 left-0 h-full bg-mBlue"
class=
"hidden absolute top-0 left-0 h-full bg-mBlue"
:class=
"
{
:class=
"
{
'!block': current
Route
=== i,
'!block': current === i,
}"
}"
style="width: 3px;"
style="width: 3px;"
>
</div>
>
</div>
...
@@ -38,8 +38,8 @@
...
@@ -38,8 +38,8 @@
import
{
onBeforeMount
}
from
"vue"
;
import
{
onBeforeMount
}
from
"vue"
;
interface
Props
{
interface
Props
{
current
Route
?:
number
;
current
?:
number
;
select
Page
?:
(
i
:
number
)
=>
void
;
select
Current
?:
(
i
:
number
)
=>
void
;
menuList
?:
{
menuList
?:
{
name
:
string
;
name
:
string
;
icon
:
string
;
icon
:
string
;
...
...
src/stories/SideBar.stories.ts
View file @
9391114b
...
@@ -4,6 +4,12 @@ import SideBar from "../components/src/SideBar";
...
@@ -4,6 +4,12 @@ import SideBar from "../components/src/SideBar";
export
default
{
export
default
{
title
:
"SideBar"
,
title
:
"SideBar"
,
component
:
SideBar
,
component
:
SideBar
,
args
:
{
sideBarWidth
:
64
,
selectCurrent
(
i
:
number
)
{
console
.
log
(
i
,
"show i"
);
},
},
};
};
const
Template
:
Story
=
(
args
)
=>
({
const
Template
:
Story
=
(
args
)
=>
({
...
@@ -35,10 +41,7 @@ Primary.args = {
...
@@ -35,10 +41,7 @@ Primary.args = {
icon
:
""
,
icon
:
""
,
},
},
],
],
current
Route
:
0
,
current
:
0
,
iconfontLink
:
"//at.alicdn.com/t/font_1321935_cdom05madx.css"
,
iconfontLink
:
"//at.alicdn.com/t/font_1321935_cdom05madx.css"
,
selectPage
(
v
:
number
)
{
console
.
log
(
v
,
"show v"
);
},
sideBarWidth
:
64
,
sideBarWidth
:
64
,
};
};
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