We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1、export
export let i = “hello”; export function myFun(){};
let i = “hello"; function myFun(){}; export {i , myFun}
2、export default
export default { props: { foo: 'foo' } }
1、export导出的对象,导入时写法:
import {i, myFun}
2、export default导出的对象,导入时写法:
import 变量名 from ‘模块’
很明显,模块只有一个默认的导出的接口,所以只有一个对象被导出,导出的对象可以自定义一个变量名。
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
导出差别
1、export
示例:
2、export default
导入差别
1、export导出的对象,导入时写法:
2、export default导出的对象,导入时写法:
很明显,模块只有一个默认的导出的接口,所以只有一个对象被导出,导出的对象可以自定义一个变量名。
原文链接:export和export default区别
The text was updated successfully, but these errors were encountered: