Skip to content

Commit

Permalink
fix: 修复搜索页缩小后布局问题
Browse files Browse the repository at this point in the history
  • Loading branch information
sl1673495 committed Aug 22, 2019
1 parent 68c8420 commit 20d4679
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/layout/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<script type="text/ecmascript-6">
import LayoutHeader from "./header"
import LayoutMenu from "./menu"
import { layoutCenterPaths } from "@/router"
import { layoutCenterNames } from "@/router"
import { mapState } from "@/store/helper/music"
export default {
Expand All @@ -34,7 +34,7 @@ export default {
},
computed: {
routerViewCls() {
return layoutCenterPaths.find(path => path === this.$route.path)
return layoutCenterNames.find(name => name === this.$route.name)
? "router-view-center"
: ""
},
Expand All @@ -59,11 +59,11 @@ export default {
.content {
flex: 1;
overflow-y: auto;
// min-width: $layout-content-min-width;
min-width: $layout-content-min-width;
margin-bottom: $mini-player-height;
.router-view-center {
max-width: $center-content-width;
max-width: $center-content-max-width;
margin: auto;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/page/search/playlists.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default {
<style lang="scss" scoped>
.search-playlists {
max-width: 1000px;
padding: 16px 0;
padding: $page-padding;
margin: auto;
.list-wrap {
Expand Down
5 changes: 4 additions & 1 deletion src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const Mvs = () => import('@/page/mvs')
const Mv = () => import('@/page/mv')

// 内容需要居中的页面
export const layoutCenterPaths = ['/discovery', '/playlists', '/songs', '/mvs']
export const layoutCenterNames = ['discovery', 'playlists', 'songs', 'mvs']

// 需要显示在侧边栏菜单的页面
export const menuRoutes = [
Expand Down Expand Up @@ -82,14 +82,17 @@ export default new Router({
},
{
path: 'songs',
name: 'searchSongs',
component: SearchSongs,
},
{
path: 'playlists',
name: 'searchPlaylists',
component: SearchPlaylists,
},
{
path: 'mvs',
name: 'searchMvs',
component: SearchMvs,
},
],
Expand Down
4 changes: 2 additions & 2 deletions src/style/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ $border: 1px solid #3f3f3f;

$page-padding: 16px 32px;
// layout
$layout-content-min-width: 1050px;
$layout-content-min-width: 700px;
// content
$center-content-width: 1000px;
$center-content-max-width: 1000px;
// header
$header-height: 50px;

Expand Down

0 comments on commit 20d4679

Please sign in to comment.