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
ecf3e64a
Commit
ecf3e64a
authored
4 months ago
by
戴 冯洋
Browse files
Options
Downloads
Patches
Plain Diff
feat:初步搭建Header部分前后端交互的api
parent
2bb8537b
No related branches found
Branches containing commit
No related tags found
1 merge request
!3
feat:初步搭建Header部分前后端交互的api
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/api/_prefix.js
+1
-0
1 addition, 0 deletions
src/api/_prefix.js
src/api/search.js
+4
-0
4 additions, 0 deletions
src/api/search.js
src/components/Header.vue
+22
-4
22 additions, 4 deletions
src/components/Header.vue
with
27 additions
and
4 deletions
src/api/_prefix.js
+
1
−
0
View file @
ecf3e64a
...
...
@@ -6,3 +6,4 @@ export const PLAYLIST_MODULE = `${API_MODULE}/playlist`
export
const
COMMENT_MODULE
=
`
${
API_MODULE
}
/comment`
export
const
MANAGER_MODULE
=
`
${
API_MODULE
}
/manager`
export
const
SHARE_MODULE
=
`
${
API_MODULE
}
/share`
export
const
SEARCH_MODULE
=
`
${
API_MODULE
}
/search`
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/api/search.js
0 → 100644
+
4
−
0
View file @
ecf3e64a
import
{
axios
}
from
'
../utils/request
'
;
import
{
SEARCH_MODULE
}
from
'
./_prefix
'
;
This diff is collapsed.
Click to expand it.
src/components/Header.vue
+
22
−
4
View file @
ecf3e64a
...
...
@@ -3,12 +3,30 @@ import { useRouter } from "vue-router";
import
{
ref
}
from
"
vue
"
;
const
router
=
useRouter
();
const
searchInput
=
ref
(
''
);
const
showDropdown
=
ref
(
false
);
function
toggleDropdown
()
{
showDropdown
.
value
=!
showDropdown
.
value
;
}
function
exit
()
{
router
.
push
(
'
/login
'
);
}
function
callPersonalData
()
{
}
function
callSetting
()
{
}
function
search
()
{
search
(
searchInput
).
then
(
res
=>
{
})
}
</
script
>
<
template
>
...
...
@@ -24,7 +42,7 @@ function toggleDropdown() {
<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=
"想播放什么?
"
/>
<input
type=
"text"
v-model=
"searchInput"
placeholder=
"想播放什么?"
@
keyup.enter=
"search
"
/>
</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"
>
...
...
@@ -33,9 +51,9 @@ function toggleDropdown() {
</svg>
</div>
<div
class=
"dropdown"
v-show=
"showDropdown"
>
<button
>
个人资料
</button>
<button
>
设置
</button>
<button
>
退出
</button>
<button
@
click=
"callPersonalData"
>
个人资料
</button>
<button
@
click=
"callSetting"
>
设置
</button>
<button
@
click=
"exit"
>
退出
</button>
</div>
</div>
</
template
>
...
...
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