Using ES6 modules, I know I can alias a named import
(使用ES6模块,我知道我可以为命名导入添加别名)
import { foo as bar } from 'my-module';
And I know I can import a default import
(而且我知道我可以导入默认导入)
import defaultMember from 'my-module';
I'd like to alias a default import and I had thought the following would work
(我想为默认导入添加别名,我认为以下内容可行)
import defaultMember as alias from 'my-module';
but that results in a parsing (syntax) error.
(但这会导致解析(语法)错误。)
How can I (or can I?) alias a default import?
(我怎么能(或者我可以?)别名默认导入?)
ask by sfletche translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…