We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Button/index.js
import Button from 'Button'
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
为什么引入Module的时候路径明明是Button/index.js,却可以用import Button from 'Button'? 这是ES6的特殊写法吗?
答:
不是。这是模块加载器的工作,ES6没有规定任何和模块加载相关的规范。
这是Nodejs模块加载器所支持的写法,Webpack等为了兼容性也支持这种写法。
ES6 (EcmaScript 2015) modules: import index.js
javascript import from '/folder' with index.js
The text was updated successfully, but these errors were encountered:
No branches or pull requests
为什么引入Module的时候路径明明是
Button/index.js
,却可以用import Button from 'Button'
?这是ES6的特殊写法吗?
答:
不是。这是模块加载器的工作,ES6没有规定任何和模块加载相关的规范。
这是Nodejs模块加载器所支持的写法,Webpack等为了兼容性也支持这种写法。
参考
ES6 (EcmaScript 2015) modules: import index.js
javascript import from '/folder' with index.js
The text was updated successfully, but these errors were encountered: