ฉันกำลังพยายามด้วยอะไรซักอย่างนี้ตอบคำบ typescript, https://stackoverflow.com/a/47570603/8503317 ในการสร้างสามีตัวเลือกนี้
var line = new fabric.Line(points, {
strokeWidth: 2,
fill: '#999999',
stroke: '#999999',
originX: 'center',
originY: 'center',
selectable: false,
hasBorders: false,
hasControls: false,
evented: false,
class:'line', //THIS DOESN'T EXIST ON FABRIC.LINE OPTIONS
นี่คือ codepen
แต่นั่น codepen มันกำลังทำงานและไม่มีข้อผิดพลาด มีใครรู้ว่าทำไม?
แก้ไข
นี่คือของฉัน reproduce https://stackblitz.com/edit/angular-ivy-bkaelf?file=src%2Fapp%2Fapp.component.ts