列表页: storeConversationList从vuex中获取
<u-list class="conversation_list" @scrolltolower="scrolltolower" v-if="storeConversationList.length">
<u-list-item v-for="item in storeConversationList" :key="item.conversationID"
@click="itemClick(item)">
<conversation-item @closeAllSwipe="closeAllSwipe" :source="item" :key="item.conversationID" />
</u-list-item>
</u-list>
conversationItem组件:
<u-swipe-action-item :index="source.conversationID ? source.conversationID : ''" @click="clickConversationMenu($event,source)"
:name="source.conversationID ? source.conversationID : ''" :options="getSwipeActions || []">
<view @tap.prevent="clickConversationItem" class="conversation_item"
:class="{conversation_item_active:source.isPinned ? source.isPinned : false }">
<view class="left_info">
<my-avatar shape="circle" :isGroup="isGroup" :isNotify="isNotify" :src="source.faceURL ? source.faceURL : ''"
:desc="source.showName ? source.showName : ''" size='48' />
<view class="details">
<text class="nic">{{source.showName ? source.showName : ''}}</text>
<view class="lastest_msg_wrap">
<text class="lastest_msg_content">{{latestMessage}}</text>
<!-- <u-parse class="lastest_msg_content"
:content="latestMessage" /> -->
</view>
</view>
</view>
<view class="right_desc">
<text class="send_time">{{latestMessageTime}}</text>
<image v-if="notAccept" src="@/static/images/conversation_not_accept.png">
<u-badge v-else max="99" :value="source.unreadCount ? source.unreadCount : ''"></u-badge>
</view>
</view>
</u-swipe-action-item>
渲染数据的时候出现了undefined
2***@qq.com (作者)
u-list是uview ui的列表组件, 应用初始化完成后我拉取15条会话数据, 然后跳转到消息页的时候在computed里...mapGetters(['storeConversationList'])获取会话数据进行渲染, 第一次渲染会出现这个问题, 退出应用再登录进来就没有undefined了,没找到问题所在, 还请大佬指示一下,谢谢!!!
2023-06-30 10:37
superfang2022
回复 2***@qq.com:我也出现和你类似的问题,列表渲染有概率出现undifined。有解决方案了吗
2023-10-13 14:54