Fabric.js在vue页面中鼠标绘画多边形 Polyline
省去在vue中install fabric.js
Draw Polygon
>Press double click to close shape and stop
>
import { fabric } from "fabric";
export default {
data() {
return {
roof: null,
roofPoints: [],
lines: [],
lineCounter: 0,
drawingObject: {},
drawingObject: {
type: "",
background: "",
border: ""
},
fabricObj: null,
mouseFrom: {},
canvas: null,
Point: {}
};
},
computed: {},
mounted() {
this.$nextTick(() => {
setTimeout(() => {
this.fabricObj = new fabric.Canvas("label-canvas");
this.fabricEvent();
}, 500);</