|
|
<template>
|
|
|
<div class="article-item-intro">
|
|
|
<div class="intro">
|
|
|
Nike 旗下大热鞋款 Air Max 95 一直以来在街头造型当中的能见度都算高,凭藉其舒适脚感与百搭外型 Air Max 95 也轻松成为许多鞋迷的心头好。近日,<span class="expand">…展开</span>
|
|
|
<div class="intro hover-opacity" :class="{'intro-expand': isExpand}" @click="onExpand">
|
|
|
{{intro}}<span class="expand" v-if="!isExpand">…展开</span>
|
|
|
<span class="expand collapse" v-else>收起</span>
|
|
|
</div>
|
|
|
<div class="widgets">
|
|
|
<div class="topic">
|
|
|
<WidgetTopic></WidgetTopic>
|
|
|
<WidgetTopic topic="种草"></WidgetTopic>
|
|
|
</div>
|
|
|
<div class="opts">
|
|
|
<WidgetLike></WidgetLike>
|
|
|
<WidgetFav></WidgetFav>
|
|
|
<WidgetShare></WidgetShare>
|
|
|
<WidgetLike num="91"></WidgetLike>
|
|
|
<WidgetFav num="99"></WidgetFav>
|
|
|
<WidgetShare num="1"></WidgetShare>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
...
|
...
|
@@ -18,7 +19,35 @@ |
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
name: 'ArticleItemIntro'
|
|
|
name: 'ArticleItemIntro',
|
|
|
props: {
|
|
|
data: {
|
|
|
type: Object,
|
|
|
default() {
|
|
|
return {};
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
isExpand: false
|
|
|
};
|
|
|
},
|
|
|
computed: {
|
|
|
intro() {
|
|
|
if (this.isExpand) {
|
|
|
return this.data.intro;
|
|
|
}
|
|
|
if (this.data.intro.length > 66) {
|
|
|
return this.data.intro.substring(0, 66);
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
onExpand() {
|
|
|
this.isExpand = !this.isExpand;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
|
...
|
...
|
@@ -30,20 +59,56 @@ export default { |
|
|
.intro {
|
|
|
font-size: 28px;
|
|
|
color: #4a4a4a;
|
|
|
letter-spacing: 0.06px;
|
|
|
letter-spacing: 0.06PX;
|
|
|
overflow: hidden;
|
|
|
display: -webkit-box;
|
|
|
text-overflow: ellipsis;
|
|
|
-webkit-line-clamp: 3;
|
|
|
-webkit-box-orient: vertical;
|
|
|
position: relative;
|
|
|
line-height: 40px;
|
|
|
|
|
|
&.intro-expand {
|
|
|
padding-bottom: 40px;
|
|
|
overflow: initial;
|
|
|
display: block;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.expand {
|
|
|
font-size: 28px;
|
|
|
color: #000;
|
|
|
letter-spacing: 0.06PX;
|
|
|
line-height: 20px;
|
|
|
font-weight: bold;
|
|
|
|
|
|
&.collapse {
|
|
|
position: absolute;
|
|
|
right: 14px;
|
|
|
bottom: 0;
|
|
|
height: 28px;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.widgets {
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
margin-top: 40px;
|
|
|
|
|
|
.topic {
|
|
|
text-align: left;
|
|
|
width: 200px;
|
|
|
}
|
|
|
|
|
|
.opts {
|
|
|
text-align: right;
|
|
|
flex: 1;
|
|
|
|
|
|
& /deep/ .icon-btn {
|
|
|
margin-left: 48px;
|
|
|
text-align: right;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</style> |
...
|
...
|
|