// 文件结构
- Card
- index.js
- components
- Footer.jsx
- Header.jsx
- wrapCard.js
我想在index.js
中将这三个文件都同时导出,其中wrapCard
中导出两个方法
// ....
export func1
export func2
index.js中该如何书写,可以在其他文件中直接访问到4个变量
// 大概这么引入
import {Footer, Header, func1, func2} from '@/Card'
###
很简单,直接导入再重新导出即可
import Footer from './components/Footer.jsx';
import Header from './components/Header.jsx';
import {func1, func2} from './components/wrapCard.js';
export {
Footer,
Header,
func1,
func2,
};