所以我确定我做错了什么,而且我同样确定我不知道它是什么。
<script src="//cdnjs.cloudflare.com/ajax/libs/fabric.js/2.2.2/fabric.js"></script>
<canvas id="starmap"></canvas>
<script>
var canvas = new fabric.Canvas('starmap');
console.log(canvas);
canvas.add(new fabric.Circle({ radius: 30, fill: '#f00', top: 10, left: 10 }));
canvas.selectionColor = 'rgba(0,255,0,0.3)';
canvas.selectionBorderColor = 'red';
canvas.selectionLineWidth = 5;
canvas.renderAll();
</script>
&#13;
使用Fabric 2.2.2,它加载到DOM中。我得到的只是一张没有内容的300x150画布。