1.
export default xxx
import 自定义名字 from '...'
2.
export const xxx = ...
export const yyy = ...
或者
const xxx = ...
const yyy = ...
export {xxx,yyy}
import * as 自定义名字 from '...'
自定义名字.xxx
或者
import {xxx,yyy} from '...'
【js】import和export的搭配用法
最新推荐文章于 2024-04-26 16:47:03 发布