Skip to content
Snippets Groups Projects
Unverified Commit d0c793cd authored by daify's avatar daify Committed by GitHub
Browse files

Merge pull request #12 from CosineSky/daify

fix:修复home按钮功能
parents 8d913efb c07e7f5b
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ import {ref} from "vue"; ...@@ -4,7 +4,7 @@ import {ref} from "vue";
import {searchSongByKeyword, searchPlaylistByKeyword} from "../api/search"; import {searchSongByKeyword, searchPlaylistByKeyword} from "../api/search";
const router = useRouter(); const router = useRouter();
const emit = defineEmits(['headData']); const emit = defineEmits(['headData','home']);
const props = defineProps({ const props = defineProps({
allowSearch: { allowSearch: {
...@@ -80,6 +80,10 @@ function callSearch() { ...@@ -80,6 +80,10 @@ function callSearch() {
console.log("Failed to fetch playlists!") console.log("Failed to fetch playlists!")
}) })
} }
function callHome() {
emit('home');
}
</script> </script>
<template> <template>
...@@ -105,14 +109,14 @@ function callSearch() { ...@@ -105,14 +109,14 @@ function callSearch() {
d="M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"></path> d="M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"></path>
</svg> </svg>
</router-link> </router-link>
<router-link to="/home" class="home-btn"> <div @click="callHome" class="home-btn">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" <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" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"
class="feather feather-home"> class="feather feather-home">
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path> <path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path>
<polyline points="9 22 9 12 15 12 15 22"></polyline> <polyline points="9 22 9 12 15 12 15 22"></polyline>
</svg> </svg>
</router-link> </div>
<div @click="toggleIcons" class="more-btn"> <div @click="toggleIcons" class="more-btn">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
<path fill="currentColor" <path fill="currentColor"
......
...@@ -466,8 +466,15 @@ function receiveDataFromHeader(data) { ...@@ -466,8 +466,15 @@ function receiveDataFromHeader(data) {
setMidComponents(3); setMidComponents(3);
} }
/*
HOME
*/
function receiveDataFromHome() {
setMidComponents(0);
}
/* /*
MID COMPONENTS MID COMPONENTS
0 - Main View
1 - Music Albums 1 - Music Albums
2 - Comments 2 - Comments
3 - Search Results 3 - Search Results
...@@ -528,7 +535,7 @@ let playFromLeftBarAlbum = ref(null); ...@@ -528,7 +535,7 @@ let playFromLeftBarAlbum = ref(null);
<div class="body" v-show="!isPlayingPage" @click="unSelectAlbum"> <div class="body" v-show="!isPlayingPage" @click="unSelectAlbum">
<!-- MAIN & RIGHT CONTENT --> <!-- MAIN & RIGHT CONTENT -->
<Header class="header" @headData="receiveDataFromHeader" allow-search></Header> <Header class="header" @headData="receiveDataFromHeader" @home="receiveDataFromHome" allow-search></Header>
<img class="logo" src="../assets/pictures/logos/logo3.png" alt=""> <img class="logo" src="../assets/pictures/logos/logo3.png" alt="">
<left-side-bar class="left-side-bar" @playFromLeftBar="(id)=>{playFromLeftBarAlbum = id }" <left-side-bar class="left-side-bar" @playFromLeftBar="(id)=>{playFromLeftBarAlbum = id }"
@setCurrentPlaylist="receiveDisplayingPlaylist"/> @setCurrentPlaylist="receiveDisplayingPlaylist"/>
...@@ -1691,7 +1698,7 @@ footer { ...@@ -1691,7 +1698,7 @@ footer {
/* 退出搜索图标 */ /* 退出搜索图标 */
.exit-search { .exit-search {
position: absolute; position: absolute;
top: 90px; top: 110px;
right: 10px; right: 10px;
width: 30px; width: 30px;
height: 30px; height: 30px;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment