Window Resize Observable     

QWindowResizeObservable is a Quasar component that emits a resize event whenever the document viewport (window) changes its size, with no polling involved.


Edit /quasar.conf.js:

framework: {
components: [

Basic Usage

<!--can be placed anywhere within your template -->
<q-window-resize-observable @resize="onResize" />

export default {
methods: {
onResize (size) {
// {
// width: 1200 // width of viewport (in px)
// height: 920 // height of viewport (in px)
// }

Please note that QWindowResizeObservable will issue an event as soon as it gets rendered and attached to DOM, so you can have the initial size of the window.

Vue Properties

Property Type Description
debounce Number (v0.17+) Emitting the event with a custom debounce. “0” means no debounce.