Skip to content

Commit 36b3f2d

Browse files
committed
update: layout style
support mobile style
1 parent e24bff5 commit 36b3f2d

File tree

4 files changed

+639
-580
lines changed

4 files changed

+639
-580
lines changed

src/components/chart/RankList.vue

Lines changed: 76 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,77 @@
1-
<template>
2-
<div class="rank">
3-
<h4 class="title">{{ title }}</h4>
4-
<ul class="list">
5-
<li :key="index" v-for="(item, index) in list">
6-
<span :class="index < 3 ? 'active' : null">{{ index + 1 }}</span>
7-
<span >{{ item.name }}</span>
8-
<span >{{ item.total }}</span>
9-
</li>
10-
</ul>
11-
</div>
12-
</template>
13-
14-
<script>
15-
export default {
16-
name: "RankList",
17-
// ['title', 'list']
18-
props: {
19-
title: {
20-
type: String,
21-
default: ''
22-
},
23-
list: {
24-
type: Array,
25-
default: null
26-
}
27-
}
28-
}
29-
</script>
30-
31-
<style lang="scss" scoped>
32-
33-
.rank {
34-
padding: 0 32px 32px 72px;
35-
36-
.list {
37-
margin: 25px 0 0;
38-
padding: 0;
39-
list-style: none;
40-
41-
li {
42-
margin-top: 16px;
43-
44-
span {
45-
color: rgba(0, 0, 0, .65);
46-
font-size: 14px;
47-
line-height: 22px;
48-
49-
&:first-child {
50-
background-color: #f5f5f5;
51-
border-radius: 20px;
52-
display: inline-block;
53-
font-size: 12px;
54-
font-weight: 600;
55-
margin-right: 24px;
56-
height: 20px;
57-
line-height: 20px;
58-
width: 20px;
59-
text-align: center;
60-
}
61-
&.active {
62-
background-color: #314659;
63-
color: #fff;
64-
}
65-
&:last-child {
66-
float: right;
67-
}
68-
}
69-
}
70-
}
71-
}
72-
1+
<template>
2+
<div class="rank">
3+
<h4 class="title">{{ title }}</h4>
4+
<ul class="list">
5+
<li :key="index" v-for="(item, index) in list">
6+
<span :class="index < 3 ? 'active' : null">{{ index + 1 }}</span>
7+
<span>{{ item.name }}</span>
8+
<span>{{ item.total }}</span>
9+
</li>
10+
</ul>
11+
</div>
12+
</template>
13+
14+
<script>
15+
export default {
16+
name: "RankList",
17+
// ['title', 'list']
18+
props: {
19+
title: {
20+
type: String,
21+
default: ''
22+
},
23+
list: {
24+
type: Array,
25+
default: null
26+
}
27+
}
28+
}
29+
</script>
30+
31+
<style lang="scss" scoped>
32+
33+
.rank {
34+
padding: 0 32px 32px 72px;
35+
36+
.list {
37+
margin: 25px 0 0;
38+
padding: 0;
39+
list-style: none;
40+
41+
li {
42+
margin-top: 16px;
43+
44+
span {
45+
color: rgba(0, 0, 0, .65);
46+
font-size: 14px;
47+
line-height: 22px;
48+
49+
&:first-child {
50+
background-color: #f5f5f5;
51+
border-radius: 20px;
52+
display: inline-block;
53+
font-size: 12px;
54+
font-weight: 600;
55+
margin-right: 24px;
56+
height: 20px;
57+
line-height: 20px;
58+
width: 20px;
59+
text-align: center;
60+
}
61+
&.active {
62+
background-color: #314659;
63+
color: #fff;
64+
}
65+
&:last-child {
66+
float: right;
67+
}
68+
}
69+
}
70+
}
71+
}
72+
73+
.mobile .rank {
74+
padding: 0 32px 32px 32px;
75+
}
76+
7377
</style>

src/components/layout/LayoutMain.vue

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
2-
<a-layout class="layout">
2+
<a-layout class="layout" :class="device">
33

44
<a-drawer
55
v-if="device === 'mobile'"
6-
wrapClassName="drawer-sider"
6+
:wrapClassName="'drawer-sider ' + theme"
77
placement="left"
88
@close="() => this.collapsed = false"
99
:closable="false"
@@ -93,6 +93,14 @@
9393
min-height: 100vh;
9494
overflow-x: hidden;
9595
96+
&.mobile {
97+
.ant-table-wrapper {
98+
.ant-table-body {
99+
overflow-y: auto;
100+
}
101+
}
102+
}
103+
96104
&.ant-layout-has-sider {
97105
flex-direction: row;
98106
}
@@ -156,6 +164,22 @@
156164
157165
// drawer-sider 自定义
158166
.ant-drawer.drawer-sider {
167+
.sider {
168+
box-shadow: none;
169+
}
170+
171+
&.dark {
172+
.ant-drawer-content {
173+
background-color: rgb(0, 21, 41);
174+
}
175+
}
176+
&.light {
177+
box-shadow: none;
178+
.ant-drawer-content {
179+
background-color: #fff;
180+
}
181+
}
182+
159183
.ant-drawer-body {
160184
padding: 0
161185
}

0 commit comments

Comments
 (0)