Tracker afterFlush 函数的异常:fabric.Canvas 不是构造函数
Exception from Tracker afterFlush function: fabric.Canvas is not a constructor
我正在通过 meteor
开发 fabric.js
应用程序。我在项目中包含了文件 http://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.4.0/fabric.min.js,我尝试定义一个简单的 canvas,如下所示,
Template.formatter.rendered = function () {
var canvas = new fabric.Canvas('fabriccanvas'); //<-- error Line
canvas.add(new fabric.Circle({ radius: 30, fill: '#f55', top: 100, left: 100 }));
canvas.selectionColor = 'rgba(0,255,0,0.3)';
canvas.selectionBorderColor = 'red';
canvas.selectionLineWidth = 5;
}
但我收到错误 Exception from Tracker afterFlush function: fabric.Canvas is not a constructor
。我对这些环境还很陌生,非常感谢各位专家帮助我解决这个问题 :) 谢谢
请确保您已将脚本放入 /client/compatibility
This folder is for compatibility JavaScript libraries that rely on
variables declared with var at the top level being exported as
globals. Files in this directory are executed without being wrapped in
a new variable scope. These files are executed before other
client-side JavaScript files.
我正在通过 meteor
开发 fabric.js
应用程序。我在项目中包含了文件 http://cdnjs.cloudflare.com/ajax/libs/fabric.js/1.4.0/fabric.min.js,我尝试定义一个简单的 canvas,如下所示,
Template.formatter.rendered = function () {
var canvas = new fabric.Canvas('fabriccanvas'); //<-- error Line
canvas.add(new fabric.Circle({ radius: 30, fill: '#f55', top: 100, left: 100 }));
canvas.selectionColor = 'rgba(0,255,0,0.3)';
canvas.selectionBorderColor = 'red';
canvas.selectionLineWidth = 5;
}
但我收到错误 Exception from Tracker afterFlush function: fabric.Canvas is not a constructor
。我对这些环境还很陌生,非常感谢各位专家帮助我解决这个问题 :) 谢谢
请确保您已将脚本放入 /client/compatibility
This folder is for compatibility JavaScript libraries that rely on variables declared with var at the top level being exported as globals. Files in this directory are executed without being wrapped in a new variable scope. These files are executed before other client-side JavaScript files.