Skip to content

fix:消息渲染无法显示图片 #1816

Description

@lichunn
Image

消息渲染无法显示图片:

  1. RobotChat.vue 会把上传图片放进 userMessage.renderContent,形如 { type: 'img', content: item.url }。
  2. contentRendererMatches 会把 type: 'img' 交给 ImgRenderer。
  3. 但 @opentiny/tiny-robot 调用自定义 renderer 时只传 message 和 contentIndex,不会把 resolver 返回项里的 content 展开成 props.content。
  4. 当前 ImgRenderer.vue 只读 props.content,所以拿不到 URL,v-if="props.content" 为 false,图片不显示。

消息渲染无法显示图片对用户体验会造成比较大的影响,建议作为遗留项,后续进行修复。

Originally posted by @chilingling in #1815 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions