We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
// d.js export default function() {}
为何使用require引用时需要取到解构default?而使用import d from './d'是正确的?
require
import d from './d'
const d = require('./d').default // import d from './d'
来看下关键字default到底是什么
default
// d.js export default function() {} // 等效于: function a() {}; export {a as default};
Import
import a from './d'; // 等效于,或者说就是下面这种写法的简写,是同一个意思 import {default as a} from './d';
参考: http://imweb.io/topic/582293894067ce9726778be9
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题
为何使用
require
引用时需要取到解构default?而使用import d from './d'
是正确的?来看下关键字
default
到底是什么default关键字
Import
参考: http://imweb.io/topic/582293894067ce9726778be9
The text was updated successfully, but these errors were encountered: