Skip to content

[TdChatContent] props 中的 onClick 类型存在隐式 any,strict 模式下报错 #4295

@Kriac

Description

@Kriac

选择框架

@tdesign/uniapp-chat

NPM 包版本

0.2.0

基础库调试库版本(如果出现问题的框架为 tdesign-miniprogram,请提供基础调试库版本)

No response

重现链接

No response

重现步骤

安装 Volar 和 vue-tsc,并在项目的 tsconfig.json 的 includes 属性中增加 node_modules/@tdesign/uniapp/global.d.ts,然后在项目创建脚本并执行:

"scripts": {
  "lint": "vue-tsc -b --noEmit"
}

跳转到对应文件应该编译器就会提示 ”成员“event”隐式包含类型“any”“。

期望结果

  1. 为相关字段补充明确类型
  2. 或使用更通用的事件类型(如 unknown 等让用户自行补充)

实际结果

目前在严格模式下无法正常通过类型检查。

这三个组件,TdChatContent、TdChatList、TdChatMarkdown 都有这个问题。

补充说明

因为项目使用了eslint,提交代码时会被拦截下来,希望官方能够处理一下,非常感谢!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions