1.自由绘


代码:

                var canvas = new fabric.Canvas("freeCanvas", {
                    isDrawingMode: true,
                    width: 400,
                    height: 250
                });
        

2.画直线


代码: