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

未关闭 适合新手
#1,816 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@dvd233 已经在做这个了。

开始于 2026年10月9日。

  • #1831 来自 @dvd233 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
76/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
领域
frontend

调研方向

首先阅读 RobotChat.vue、contentRendererMatches 和 ImgRenderer.vue,以跟踪上传图片的 URL 如何从 renderContent 传递到自定义 renderer。检查 issue 中描述的 @opentiny/tiny-robot renderer 调用,并在上传的用户图片能够使用其 URL 进行渲染而不是被隐藏时,视为工作完成。

由索引模型根据 Issue 内容生成。

描述

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 https://github.com/opentiny/tiny-engine/pull/1815#discussion_r3491594780

主要语言
Vue
星标
2.8k
派生
482
平均合并
14 天 8 小时
30 天内合并 PR
1

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

opentiny/tiny-engine 的其他 Issue

查看 opentiny/tiny-engine 的全部 Issue

相似的 Issue

更多 Web Dev Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。