content报错问题

This commit is contained in:
shijingjing
2022-07-28 15:18:49 +08:00
parent 72af082d3b
commit 8f68ef6465

View File

@@ -45,7 +45,7 @@
<p>群发内容</p>
<div>
<!-- 文本 -->
<div class="textarea" v-show="content && content.length>0">{{ content[0].content }}</div>
<div class="textarea" v-show="content.length">{{ content }}</div>
<!-- 图片 -->
<div class="pictures" v-show="picList.length">
<image v-for="(item, index) in picList" :key="index" :src="item.imgPicUrl" @click.stop="previewImages(picList, item.imgPicUrl)"/>
@@ -91,7 +91,7 @@ export default {
return {
id: "",
data: {},
content: [],
content: '',
picList: [],
videoList: [],
fileList: [],
@@ -113,7 +113,7 @@ export default {
this.$http.post(`/app/appmasssendingtask/queryDetailById?id=${this.id}`).then(res=> {
if (res?.data) {
this.data = res.data
this.content = res.data.contents.filter(v=> v.msgType == 0)
this.content = res.data.contents.filter(v=> v.msgType == 0)?.[0].content
this.picList = res.data.contents.filter(v=> v.msgType == 1)
this.videoList = res.data.contents.filter(v=> v.msgType == 2)
this.fileList = res.data.contents.filter(v=> v.msgType == 3)