我有一个模块Module.js
Portlet.js
const Colors=["blue","yellow"];
const Colors2={
mycolors:["black","green"]
}
export default class test{};
export {Colors,Colors2}现在,我想使用颜色和Colors2从另一个模块。
Other.js
import {Colors} from "./Module.js"
import {Colors2} from "./Module.js"但是,当我尝试使用它们时,我总是得到模块。颜色/2是未知的!它有可能导出一个const并在另一个模块中重用吗?是的,如何实现?
发布于 2017-05-09 07:11:59
进出口一切正常,所有问题都是由反应引起的。
https://stackoverflow.com/questions/43849702
复制相似问题