ResizeObserver 缩放观察

代码示例#

API#

预设类型#

ts
type ResizeHandler = (entry: ResizeObserverEntry) => any

interface VResizeOptions {
  handler: ResizeHandler,
  throttle?: boolean | number,
  disabled?: boolean
}

ResizeObserver 属性#

名称类型说明默认值始于
disabledboolean设置是否禁用false2.2.8
on-resize(entry: ResizeObserverEntry) => any大小变化后的回调null-
throttleboolean | number设置是否开启回调的节流,传入数字时可以定制节流的毫秒数false-

ResizeObserver 指令#

名称说明参数始于
v-resize用于为元素快速添加缩放回调,支持 .throttle 修饰符(binding: ResizeHandler | VResizeOptions)2.3.0