mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-10 19:36:43 +08:00
提交
This commit is contained in:
@@ -69,7 +69,15 @@
|
||||
<h6>{{ item.sysUpdateTime }}</h6>
|
||||
</div>
|
||||
<div class="all-content" style="word-break:break-all;">
|
||||
<span v-if="item.contentType != 3">{{ item.content }}</span>
|
||||
<span v-if="item.type == 1">{{item.content}}</span>
|
||||
|
||||
<span v-if="item.contentType != 3 && item.type == 2">
|
||||
<!-- {{ item.content }} -->
|
||||
{{displayAll(item)}}
|
||||
<span style="color:#588afc;cursor:pointer;" v-if="item.content && item.content.length>150" @click.stop="changeIsAll(item)">
|
||||
{{item.isAll?'收起':'全文展开'}}
|
||||
</span>
|
||||
</span>
|
||||
<div v-else>
|
||||
<template v-for="img in item.content">
|
||||
<img @click="showBigImg(fileBaseUrl + img)" :src="fileBaseUrl + img" alt="" style="max-width: 400px;"/>
|
||||
@@ -266,6 +274,15 @@ export default {
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
displayAll(item) {
|
||||
if (!item.isAll && item.content && item.content.length > 180) {
|
||||
return item.content.slice(0, 150) + "...";
|
||||
}
|
||||
return item.content;
|
||||
},
|
||||
changeIsAll(item) {
|
||||
item.isAll = !item.isAll;
|
||||
},
|
||||
// 笔记图片放大
|
||||
showBigImg(path){
|
||||
this.currentImagePath = path;
|
||||
@@ -535,6 +552,9 @@ export default {
|
||||
apiNote.query(data).then(res=>{
|
||||
if(res.status == 200) {
|
||||
res.result.list.forEach((item,index)=>{
|
||||
if(item.type == 2 && item.contentType !== 3) {
|
||||
item.isAll = false;
|
||||
}
|
||||
if(item.contentType == 3) {
|
||||
item.content = item.content.split(',');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user