Tencent / tdesign-miniprogram

A Wechat MiniProgram UI components lib for TDesign.
https://tdesign.tencent.com/miniprogram
MIT License
1.2k stars 275 forks source link

[toast] 找不到模块“tdesign-miniprogram/toast/index”或其相应的类型声明。 #2878

Closed matianhe3 closed 1 month ago

matianhe3 commented 3 months ago

tdesign-miniprogram 版本

1.4.2

重现链接

No response

重现步骤

import Toast from "tdesign-miniprogram/toast/index";

期望结果

小程序可以运行, 但是开发者工具报错.

实际结果

image

基础库版本

3.4.6

补充说明

image 按照示例复制代码

github-actions[bot] commented 3 months ago

👋 @matianhe3,感谢给 TDesign 提出了 issue。 请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

anlyyao commented 3 months ago

@matianhe3 开发工具上有勾选“将JS编译成ES5”选项吗

matianhe3 commented 3 months ago

@matianhe3 开发工具上有勾选“将JS编译成ES5”选项吗

勾选了 image

anlyyao commented 3 months ago

@matianhe3 https://developers.weixin.qq.com/s/l0azMimf7CSu 这里有个toast组件示例的代码片段,你导入开发者工具试试

npm i -> 构建npm包

matianhe3 commented 3 months ago

@matianhe3 https://developers.weixin.qq.com/s/l0azMimf7CSu 这里有个toast组件示例的代码片段,你导入开发者工具试试

npm i -> 构建npm包

有没有typescript版的, 打开看是js的.

anlyyao commented 3 months ago

@matianhe3 https://developers.weixin.qq.com/s/l0azMimf7CSu 这里有个toast组件示例的代码片段,你导入开发者工具试试

npm i -> 构建npm包

有没有typescript版的, 打开看是js的.

没有本质区别

matianhe3 commented 3 months ago

@matianhe3 https://developers.weixin.qq.com/s/l0azMimf7CSu 这里有个toast组件示例的代码片段,你导入开发者工具试试

npm i -> 构建npm包

有没有typescript版的, 打开看是js的.

没有本质区别

代码片段没有报错提示

anlyyao commented 3 months ago

@matianhe3 所以需要你提供一个能复现报错提示的代码片段给我,可以基于上面的片段链接修改或者新建代码片段,重新提供链接

matianhe3 commented 3 months ago

@matianhe3 所以需要你提供一个能复现报错提示的代码片段给我,可以基于上面的片段链接修改或者新建代码片段,重新提供链接

https://developers.weixin.qq.com/s/UQqPzsmA7oSf

anlyyao commented 3 months ago

@matianhe3 所以需要你提供一个能复现报错提示的代码片段给我,可以基于上面的片段链接修改或者新建代码片段,重新提供链接

https://developers.weixin.qq.com/s/UQqPzsmA7oSf

get到你说的"报错"了 🤦,改成 import { Toast } from 'tdesign-miniprogram';

matianhe3 commented 3 months ago

@matianhe3 所以需要你提供一个能复现报错提示的代码片段给我,可以基于上面的片段链接修改或者新建代码片段,重新提供链接

https://developers.weixin.qq.com/s/UQqPzsmA7oSf

get到你说的"报错"了 🤦,改成 import { Toast } from 'tdesign-miniprogram';

image 之前试过这样改, 会编译不成功.

anlyyao commented 3 months ago

https://developers.weixin.qq.com/s/odzz7smx7FSP

我这边没能复现你控制台的报错、