在天才聊天中,有一个image
字段可以是指向要显示的图像的 URL。这是一个消息示例:
{
_id: 30,
createdAt: new Date(),
image: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Paris_-_Eiffelturm_und_Marsfeld2.jpg/280px-Paris_-_Eiffelturm_und_Marsfeld2.jpg',
user: {
_id: 2,
name: 'React Native',
},
},
对于存储在变量中的图像文件img
,如何在聊天消息中显示它?message.image = img
不工作。