首页
我有Bug
热爱分享
作品展示
喜欢
干货分享
登录
注册
首页
>
我的BUG
>
菜鸟栏
>
typescript:此导入从不用作值,必须使用 "impo...
回复
« 返回列表
doubleyong
管理员
最后登录
2025-02-06
发帖数
1196
加关注
写私信
阅读:
2445
回复:
0
[前端]
typescript:此导入从不用作值,必须使用 "import type" ,因为 "importsNotUsedAsValues" 设置为 "error"
楼主
#
更多
只看楼主
倒序阅读
发布于:2023-08-08 10:52
保存
错误:
此导入从不用作值,必须使用 "import type" ,因为 "importsNotUsedAsValues" 设置为 "error"
,代码如下:
import { ITraining } from "@/typing/ManageMent/Market/index"
原因:
当导入的是一个类型时,用import type 替换import
解决方案:
import type { ITraining } from "@/typing/ManageMent/Market/index"
喜欢
0
最新喜欢:
知识需要管理,知识需要分享
回复
发帖
回复
« 返回列表
普通帖
您需要登录后才可以回帖,
登录
或者
注册
返回顶部
公众号
关闭
最新喜欢