调整监视器大小(用于元素)
QResizeObserver 是一个 Quasar 组件,每当封装的 DOM 元素/组件(定义为 QResizeObserver 的直接父级)更改其大小(宽度和/或高度)时,它都会发出 resize
事件。请注意,不涉及轮询,但过度使用轮询也会造成高昂的成本。
¥QResizeObserver is a Quasar component that emits a resize
event whenever the wrapping DOM element / component (defined as direct parent of QResizeObserver) changes its size (width and/or height). Note that no polling is involved, but overusing it is costly too.
用法(Usage)
¥Usage
请注意,QResizeObserver 在渲染并附加到 DOM 后会立即触发事件,因此你可以获得容器的初始大小。
¥Please note that QResizeObserver will issue an event as soon as it gets rendered and attached to DOM, so you can have the initial size of the container.