[英]is there `from <module> import <class>` syntax in ES6?
例如,在 ES6 中导入:
import MyClass from "module";
问题是智能感知没有像 python 那样拾取。 在 python 中,例如:
from mo
到这里,intellisense 已经开始工作,并会提供完整的module
from module import M
and here 已经提供了所有以 M 开头的类。
代替import Class from module
有没有办法在 ES6 中from module import Class
做?
它依赖于 IDE。 我在 VS Code 中发现Bergi所说的方法效果很好,从import {} from Module
开始,然后从那里开始。 同样,这取决于 IDE。 当一个模块只导出一个东西时,你负责那个变量的命名。
快乐编码!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.