-
-
Notifications
You must be signed in to change notification settings - Fork 378
Open
Description
比如我有一个 tsx 文件:
export const A = (props) {
return <div>A</div>
}
export const B = (props) {
return <div>B</div>
}
- 这个文件可能没有默认导出;
- 可能只有一个命名导出,也可能是多个;
- 可能需要识别是否是组件?
- 使用
resolvers
尝试了一下,如果是用path.resolve
设置绝对路径,页面中会报错无法找到该文件,如果使用相对于vite.config.js
的相对目录,通样也会包找不到错误,只有使用alias
如 '@/components/A.tsx' 时可以正常工作
如何自动导入
Metadata
Metadata
Assignees
Labels
No labels