【发布时间】:2021-03-15 10:57:48
【问题描述】:
我刚刚在 wwwroot/js/base.js 上创建了一个 js 模块文件:
export const elements = {
...somthing
};
当我尝试从 wwwroot/js/site.js 导入时,比如
import {elements} from './base';
我得到这个错误:
Uncaught SyntaxError: Cannot use import statement outside a module
我错过了什么?
【问题讨论】:
标签: javascript asp.net-core-mvc