Skip to content

Commit fd65f41

Browse files
committed
fix: card-list flex block
1 parent c59e32b commit fd65f41

File tree

1 file changed

+35
-11
lines changed

1 file changed

+35
-11
lines changed

src/views/list/CardList.vue

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<template v-else>
1515
<a-card :hoverable="true">
1616
<a-card-meta>
17-
<div style="margin-bottom: 3px" slot="title">{{ item.title }}</div>
17+
<a slot="title">{{ item.title }}</a>
1818
<a-avatar class="card-avatar" slot="avatar" :src="item.avatar" size="large"/>
1919
<div class="meta-content" slot="description">{{ item.content }}</div>
2020
</a-card-meta>
@@ -59,6 +59,38 @@ export default {
5959
</script>
6060

6161
<style lang="less" scoped>
62+
@import "~@/components/index.less";
63+
64+
.card-list {
65+
/deep/ .ant-card-body:hover {
66+
.ant-card-meta-title>a {
67+
color: @primary-color;
68+
}
69+
}
70+
71+
/deep/ .ant-card-meta-title {
72+
margin-bottom: 12px;
73+
74+
&>a {
75+
display: inline-block;
76+
max-width: 100%;
77+
color: rgba(0,0,0,.85);
78+
}
79+
}
80+
81+
/deep/ .meta-content {
82+
position: relative;
83+
overflow: hidden;
84+
text-overflow: ellipsis;
85+
display: -webkit-box;
86+
height: 64px;
87+
-webkit-line-clamp: 3;
88+
-webkit-box-orient: vertical;
89+
90+
margin-bottom: 1em;
91+
}
92+
}
93+
6294
.card-avatar {
6395
width: 48px;
6496
height: 48px;
@@ -67,6 +99,7 @@ export default {
6799
68100
.ant-card-actions {
69101
background: #f7f9fa;
102+
70103
li {
71104
float: left;
72105
text-align: center;
@@ -84,7 +117,7 @@ export default {
84117
display: inline-block;
85118
width: 100%;
86119
&:hover {
87-
color: #1890ff;
120+
color: @primary-color;
88121
}
89122
}
90123
}
@@ -97,13 +130,4 @@ export default {
97130
height: 188px;
98131
}
99132
100-
.meta-content {
101-
position: relative;
102-
overflow: hidden;
103-
text-overflow: ellipsis;
104-
display: -webkit-box;
105-
height: 64px;
106-
-webkit-line-clamp: 3;
107-
-webkit-box-orient: vertical;
108-
}
109133
</style>

0 commit comments

Comments
 (0)