所以,几天前我寻求帮助并解决了问题,但是问题又在我制作了第二个模块并开始导入和导出时又返回了,有帮助吗?
html:
In order to Consume this response you have two options:
main.js:
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<canvas id='canvas' width=600 height=400></canvas>
<script type='module/javascript' src='main.js'></script>
<script type='module/javascript' src='classes/player.js'></script>
</body>
</html>
player.js:
import { Player } from 'classes/player.js';
var canvas = document.getElementById("canvas"),
c = canvas.getContext("2d"),
width = canvas.width,
height = canvas.height;
c.scale(1, -1);
c.translate(0, -width);