Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
2
2024-HCI-Mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
米 天为
2024-HCI-Mirror
Commits
6dab3d3b
Unverified
Commit
6dab3d3b
authored
4 months ago
by
daify
Committed by
GitHub
4 months ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #2 from CosineSky/header_development_daify
feat:完善header的搜索框和角色按钮
parents
9f51f33a
2bb8537b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/Header.vue
+91
-16
91 additions, 16 deletions
src/components/Header.vue
with
91 additions
and
16 deletions
src/components/Header.vue
+
91
−
16
View file @
6dab3d3b
<
script
setup
>
import
{
useRouter
}
from
"
vue-router
"
;
import
{
useRouter
}
from
"
vue-router
"
;
import
{
ref
}
from
"
vue
"
;
const
router
=
useRouter
();
const
showDropdown
=
ref
(
false
);
function
toggleDropdown
()
{
showDropdown
.
value
=!
showDropdown
.
value
;
}
const
router
=
useRouter
()
</
script
>
<
template
>
...
...
@@ -12,8 +19,24 @@ const router = useRouter()
<polyline
points=
"9 22 9 12 15 12 15 22"
></polyline>
</svg>
</router-link>
<input
type=
"text"
placeholder=
"想播放什么?"
/>
<button
class=
"login-btn"
>
登录
</button>
<div
class=
"search-box"
>
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"24"
height=
"24"
viewBox=
"0 0 24 24"
fill=
"none"
stroke=
"currentColor"
stroke-width=
"2"
stroke-linecap=
"round"
stroke-linejoin=
"round"
class=
"feather feather-search"
>
<circle
cx=
"11"
cy=
"11"
r=
"8"
></circle>
<line
x1=
"21"
y1=
"21"
x2=
"16.65"
y2=
"16.65"
></line>
</svg>
<input
type=
"text"
placeholder=
"想播放什么?"
/>
</div>
<div
class=
"role-btn"
@
click=
"toggleDropdown"
>
<svg
xmlns=
"http://www.w3.org/2000/svg"
width=
"24"
height=
"24"
viewBox=
"0 0 24 24"
fill=
"none"
stroke=
"currentColor"
stroke-width=
"2"
stroke-linecap=
"round"
stroke-linejoin=
"round"
class=
"feather feather-user"
>
<path
d=
"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"
></path>
<circle
cx=
"12"
cy=
"7"
r=
"4"
></circle>
</svg>
</div>
<div
class=
"dropdown"
v-show=
"showDropdown"
>
<button
>
个人资料
</button>
<button
>
设置
</button>
<button
>
退出
</button>
</div>
</div>
</
template
>
...
...
@@ -46,26 +69,42 @@ const router = useRouter()
}
.home-btn
svg
{
width
:
24px
;
height
:
24px
;
margin-right
:
5px
;
width
:
32px
;
height
:
32px
;
margin-right
:
10px
;
}
.search-box
{
display
:
flex
;
align-items
:
center
;
margin-right
:
10px
;
color
:
#fff
;
text-decoration
:
none
;
}
.search-box
svg
{
width
:
32px
;
height
:
32px
;
margin-right
:
10px
;
}
input
[
type
=
"text"
]
{
padding
:
5px
;
border-radius
:
5px
;
margin
:
auto
;
width
:
50%
;
height
:
50%
;
width
:
1
50%
;
height
:
1
50%
;
background-color
:
rgba
(
200
,
187
,
255
,
0.6
);
border
:
2px
solid
rgba
(
222
,
215
,
255
,
0.9
);
box-shadow
:
0
4px
8px
rgba
(
200
,
187
,
255
,
0.3
);
color
:
#fff
;
font-size
:
18px
;
}
input
[
type
=
"text"
]
::placeholder
{
color
:
#fff
;
opacity
:
0.7
;
font-size
:
1
6
px
;
font-size
:
1
8
px
;
}
input
[
type
=
"text"
]
:focus
{
...
...
@@ -73,13 +112,49 @@ input[type="text"]:focus {
border-color
:
#fff
;
}
.
login
-btn
{
background-color
:
rgb
(
77
,
58
,
162
)
;
border
:
4px
solid
rgb
(
234
,
229
,
255
)
;
box-shadow
:
0
6px
10px
rgba
(
200
,
187
,
255
,
0.4
)
;
.
role
-btn
{
display
:
flex
;
align-items
:
center
;
margin-right
:
10px
;
color
:
#fff
;
padding
:
5px
10px
;
border-radius
:
5px
;
text-decoration
:
none
;
cursor
:
pointer
;
}
.role-btn
svg
{
width
:
32px
;
height
:
32px
;
margin-right
:
10px
;
}
.dropdown
{
position
:
absolute
;
top
:
100%
;
right
:
0
;
background-color
:
rgba
(
17
,
6
,
58
,
0.7
);
border
:
1px
solid
#ccc
;
box-shadow
:
0
2px
4px
rgba
(
0
,
0
,
0
,
0.2
);
z-index
:
1
;
display
:
flex
;
flex-direction
:
column
;
align-items
:
flex-start
;
width
:
120px
;
}
.dropdown
button
{
width
:
100%
;
padding
:
10px
;
border
:
none
;
cursor
:
pointer
;
transition
:
background-color
0.3s
ease
;
background-color
:
rgba
(
17
,
6
,
58
,
0.7
);
color
:
#fff
;
text-align
:
left
;
font-size
:
18px
;
}
.dropdown
button
:last-child
{
margin-top
:
1px
;
border-top
:
1px
solid
#fff
;
}
</
style
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment