Skip to content
Discussion options

You must be logged in to vote

Hello,

// https://grapesjs.com/docs/api/component.html#getel
const imageElement = imageComponent.getEl()

// https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect
const { width: imageWidth, height: imageHeight } = imageElement.getBoundingClientRect()

console.log('imageDimensions', {
  imageWidth,
  imageHeight
})

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jaspreet-singh-1999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants