Closed Ana-wys closed 4 months ago
addLabel() { this.step = 'label' const width = this.imageSize.width / 3 const height = this.imageSize.height / 3 const options = { ...this.shapeOption, width, height, } // console.log(33, options) console.log(4, this.editorInstance)
this.editorInstance .addShape('rect', options) .then((objectProps) => { // 使用箭头函数确保`this`指向Vue实例 console.log('Added label with ID:', objectProps.id) }) .catch((err) => { console.error('Error adding label:', err) }) },
Error adding label: TypeError: Cannot read properties of undefined (reading 'stopDrawingMode')
addLabel() { this.step = 'label' const width = this.imageSize.width / 3 const height = this.imageSize.height / 3 const options = { ...this.shapeOption, width, height, } // console.log(33, options) console.log(4, this.editorInstance)
Error adding label: TypeError: Cannot read properties of undefined (reading 'stopDrawingMode')