{{item.releaseTime}}
-
+
@@ -101,13 +101,23 @@ export default{
newshow:[],
rest:[],
newslist:[],
- page:0
+ page:0,
+ content:''
}
},
mounted(){
getnews({'page':0}).then((res)=>{
this.newslist=res.data.content
- this.newshow=this.newslist.slice(0,3)
+
+ let arr=this.newslist.slice(0,3)
+
+ // 遍历数组,对每个对象的richText属性进行处理
+arr.forEach(item => {
+ // 去除所有标签和空格
+ item.content = item.content.replace(/<[^>]+>/g, '').trim();
+});
+ this.newshow=arr
+
})
},
methods:{
diff --git a/src/views/projectdetail.vue b/src/views/projectdetail.vue
index 79c8611..9ed4f0e 100644
--- a/src/views/projectdetail.vue
+++ b/src/views/projectdetail.vue
@@ -5,11 +5,11 @@
{{item.name}}
{{ item.source }}
{{item.name}}