David-Desmaisons/Vue.resize
关于
Vue directive to detect resize events with deboucing and throttling capacity.
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Vue.resize
Vue directive to detect HTML resize events based on CSS Element Queries with debouncing and throttling capacity.
Demo

Typical usage
Simple
Use this option when you need to receive all the resize events.
The onResize function will be called each time the element resizes with the corresponding HTML element as only argument.
<div v-resize="onResize">
Throttle
Use throttle when you need to rate-limit resize events frequency.
- With default timeout (150 ms):
<div v-resize:throttle="onResize">
- With custom timeout (in ms):
<div v-resize:throttle.100="onResize">
Debounce
Use debounce when you only need to be notified when resize events ends.
- With default timeout (150 ms):
<div v-resize:debounce="onResize">
- With custom timeout (in ms):
<div v-resize:debounce.50="onResize">
Initial
Use this option to receive the resize callback right after the element is mounted on the DOM and visible.
<div v-resize.initial="onResize">
Installation
- Available through npm:
npm install vue-resize-directive --save
- For Modules
// ES6
import resize from 'vue-resize-directive'
//...
export default {
directives: {
resize,
}
//...
// ES5
var resize = require('vue-resize-directive')
For
<script>IncludeJust include
Vueresize.jsafterResizeSensor.jsfrom css-element-queries andlodash.jsscript.
探索相关项目
加载中…