关于umi4的导出的模块的类型和一些自定义目录名称 #10748
Replies: 3 comments 7 replies
-
如果你用的是 umi + 插件,从 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
7 replies
-
关键代码是 {
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"moduleResolution": "node",
"importHelpers": true,
"jsx": "react-jsx",
"esModuleInterop": true,
"sourceMap": true,
"baseUrl": "./",
"strict": true,
"resolveJsonModule": true,
"allowSyntheticDefaultImports": true,
"paths": {
"@/*": ["src/*"],
"@@/*": ["src/.umi/*"],
"@umijs/max/typings": ["src/.umi/typings"]
}
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
umi4用到现在感觉还是很顺手的, 但有个问题一直在困扰着我, 就是umi4导出的模块的类型, 比如:
然后编辑器会在导出的这3个变量下方显示红色波浪线, 意为: 模块“"umi"”没有导出的成员“xxx”。
这个问题倒不影响使用, 但看起来很难受, 有没有什么方法能解决这个问题呢? 目前umi用的是最新版4.0.57, 是需要装个
@types/xxx
这种吗? 但我找了下, 似乎只有umi3的类型包另外就是我突发奇想, 将自定义hooks放到了如下的文件夹中:
这个
/src/hooks
目录不会对umi
的约定目录造成什么影响吧? 目前开发倒是没遇到什么问题, 以及文档中没有提及这样的目录大佬求解答@fz6m, 蟹蟹
Beta Was this translation helpful? Give feedback.
All reactions