【发布时间】:2020-05-17 06:35:49
【问题描述】:
对于最简单的 Konva 演示,我在 Firefox 控制台中收到一条错误消息。 HTML 页面:
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/konva@4.1.0/konva.min.js"></script>
<meta charset="utf-8" />
<title>Konva Warning Demo</title>
</head>
<body>
<div id="container"style="width: 800px;height: 600px;" ></div>
<script>
var stage = new Konva.Stage({
container: 'container',
width: 3000,
height: 3000,
});
</script>
</body>
</html>
在控制台中给我这组消息:
Expected declaration but found ‘[’. Skipped to next declaration. 3 konvatest.html
Error in parsing value for ‘width’. Declaration dropped. konvatest.html
Error in parsing value for ‘height’. Declaration dropped. konvatest.html
它没有给我行号,但我担心宽度和高度的值可能没有设置。而且我根本不理解“[”的问题。
如果我注释掉 Konva.Stage 的声明,消息就会消失。
这是一个非问题还是只是 Firefox 的一个特性?还是我在声明中可能做错了什么?
谢谢。
【问题讨论】:
-
我没有看到代码有任何问题。它应该运作良好。而且我在 Firefox 中没有看到这样的错误。也许你可以忽略它们。
-
谢谢。有趣的是,您在控制台中看不到这些错误。
标签: javascript firefox konvajs