mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 11:56:44 +08:00
我的收藏加展开收起
This commit is contained in:
@@ -18,8 +18,14 @@
|
||||
<!-- <span style="margin-top:2px">收藏时间:{{ item.time || item.favoritesTime | timeFilter }}</span> -->
|
||||
<!-- <interactBar :type="0" :data="item.cases" :shares="false" :views="false"></interactBar> -->
|
||||
</div>
|
||||
<div class="article-info-summary three-line-ellipsis">
|
||||
<router-link :to="'/case/detail?id='+item.cases.id" > {{item.cases.summary}}</router-link>
|
||||
<div class="article-info-summary ">
|
||||
<!-- <router-link :to="'/case/detail?id='+item.cases.id" > -->
|
||||
{{displayAll(item)}}
|
||||
<span style="color:#588afc;cursor:pointer;" v-if="item.cases.summary.length>100" @click="changeIsAll(item,idx)">
|
||||
{{item.isAll?'收起':'展开'}}
|
||||
</span>
|
||||
<!-- </router-link> -->
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<interactBar :type="3" :readonly="true" :data="item" :views="false" :shares="false"></interactBar>
|
||||
@@ -48,6 +54,17 @@
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
displayAll(item) {
|
||||
if (!item.isAll && item.cases.summary && item.cases.summary.length > 100) {
|
||||
return item.cases.summary.slice(0, 100) + "...";
|
||||
}
|
||||
return item.cases.summary;
|
||||
},
|
||||
changeIsAll(item,idx) {
|
||||
console.log(item.isAll)
|
||||
item.isAll = !item.isAll;
|
||||
this.$set(this.items, idx, item);
|
||||
},
|
||||
delItem(item){
|
||||
this.$confirm('您确定要取消收藏所选案例吗?', '删除提示', {
|
||||
confirmButtonText: '确定',
|
||||
|
||||
Reference in New Issue
Block a user