Files
AlgerMusicPlayer/src/layout/AppLayout.vue
T

69 lines
2.0 KiB
Vue
Raw Normal View History

2021-07-19 17:36:48 +08:00
<template>
<div class="layout-page">
<div class="layout-main">
2021-07-20 22:46:18 +08:00
<div class="flex">
2021-07-21 15:01:39 +08:00
<!-- 侧边菜单栏 -->
2021-07-20 22:46:18 +08:00
<app-menu class="menu" :menus="menus" />
<div class="main">
2021-07-21 15:01:39 +08:00
<!-- 搜索栏 -->
<search-bar />
<!-- 主页面路由 -->
2021-09-28 17:31:20 +08:00
<n-layout class="main-content bg-black" :native-scrollbar="false">
2021-09-29 22:26:29 +08:00
<n-message-provider>
<router-view class="main-page" v-slot="{ Component }">
<keep-alive>
<component :is="Component" v-if="$route.meta.keepAlive" />
</keep-alive>
<component :is="Component" v-if="!$route.meta.keepAlive" />
</router-view>
</n-message-provider>
2021-09-28 17:31:20 +08:00
</n-layout>
</div>
2021-07-20 22:46:18 +08:00
</div>
2021-07-21 15:01:39 +08:00
<!-- 底部音乐播放 -->
2021-07-21 17:45:21 +08:00
<play-bar v-if="isPlay" />
2021-07-19 17:36:48 +08:00
</div>
</div>
</template>
<script lang="ts" setup>
2021-07-21 17:45:21 +08:00
import type { SongResult } from '@/type/music';
import { computed } from 'vue';
import { useStore } from 'vuex';
2021-07-21 15:01:39 +08:00
import { AppMenu, PlayBar, SearchBar } from './components';
2021-07-21 17:45:21 +08:00
const store = useStore();
2021-07-21 17:45:21 +08:00
const isPlay = computed(() => store.state.isPlay as boolean)
const menus = store.state.menus;
2021-07-21 17:45:21 +08:00
2021-07-19 17:36:48 +08:00
</script>
<style lang="scss" scoped>
.layout-page {
width: 100vw;
height: 100vh;
2021-07-19 23:13:22 +08:00
@apply flex justify-center items-center overflow-hidden;
2021-07-19 17:36:48 +08:00
}
.layout-main {
2021-07-20 22:46:18 +08:00
@apply bg-black rounded-lg mb-10 text-white shadow-xl flex-col relative;
height: 900px;
width: 1500px;
overflow: hidden;
min-width: 1500px;
2021-07-19 17:36:48 +08:00
.menu {
2021-07-19 23:13:22 +08:00
width: 90px;
2021-07-19 17:36:48 +08:00
}
.main {
2021-07-20 22:46:18 +08:00
@apply pt-6 pr-6 flex-1 box-border;
2021-09-28 17:31:20 +08:00
&-content {
2021-07-20 22:46:18 +08:00
@apply rounded-2xl;
2021-09-28 17:31:20 +08:00
height: 834px;
}
&-page {
2021-09-29 15:26:13 +08:00
margin: 20px 0;
2021-07-20 22:46:18 +08:00
}
2021-07-19 17:36:48 +08:00
}
}
</style>