nhn / tui.image-editor

🍞🎨 Full-featured photo image editor using canvas. It is really easy, and it comes with great filters.
http://ui.toast.com/tui-image-editor
MIT License
6.83k stars 1.26k forks source link

addShape Bug #906

Closed Ana-wys closed 4 months ago

Ana-wys commented 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)
    })
},

微信图片_20240220140239 Error adding label: TypeError: Cannot read properties of undefined (reading 'stopDrawingMode')