50k4
50k4

Reputation: 251

How to determine Vue.js + Vuetify Component Size

In a vue.js with vuetify SPA I would like to determine what is the maximum size that my webassembly application can occupy. I need to give exact width and height coordinates to the wasm app and I would like to embedd it between a v-toolbar and a v-footer.

I could get the overall window size and substract a hard coded value (compensating for the toolbar and the footer), but the most elegant solution would be to determine the maximum size available for the component.

  1. Is there a way to do this?
  2. Is there an event which would be fired by the framework if the dimentions change?

Upvotes: 0

Views: 488

Answers (1)

LShapz
LShapz

Reputation: 1756

There isn't an event that would be fired by Vue necessarily, but the ResizeObserver browser API might be useful to you. (Here's a better explanation than the docs.) You can set it up to watch for the resize of your WASM app's containing element.

Upvotes: 1

Related Questions