从另一个文件导出对象不起作用 - JS
Export an object form another file didnt work - JS
我在 JavaScript 中将函数用作对象。
我查看导入对象的 documentation 和
我试图在 map.js 中制作 class,我想要在 main.js 中制作这个 class。
main.js
import {Map} from 'map';
var myMap = new Map();
map.js
export function Map () {
this.a;
this.b
this.sum() = function(){
}
....
};
正如我所见,我的代码中的一切都很好。为什么我还是没有工作?
与 webStorm 有任何联系吗?
我不想使用 Node.js 只是 Js。
我在 JavaScript 中将函数用作对象。 我查看导入对象的 documentation 和 我试图在 map.js 中制作 class,我想要在 main.js 中制作这个 class。
main.js
import {Map} from 'map';
var myMap = new Map();
map.js
export function Map () {
this.a;
this.b
this.sum() = function(){
}
....
};
正如我所见,我的代码中的一切都很好。为什么我还是没有工作? 与 webStorm 有任何联系吗? 我不想使用 Node.js 只是 Js。