以下是我的示例文件:
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<script src="t1.js"></script>
</head>
<body></body>
</html>
t1.js:
import Test from 't2.js';
t2.js:
export const Test = console.log("Hello world");
当我在Firefox46中加载页面时,它返回"SyntaxError:import声明可能只出现在模块的顶层"--但是我不确定import语句在这里还能达到多少顶层.这个错误是在转移视线吗?是否还不支持导入/导出?