npm install element-resize-detector
var erdUltraFast = elementResizeDetectorMaker ({ Strategy: "Scroll" // <- Recommended hyper-fast scrolling mode });
// custom-vue a resize command V Import Debounce {} from 'lodash-ES' Import elementResizeDetector from 'a resize-Detector-Element' // function debounce operation that is invoked when n milliseconds, the operation will be performed If this n milliseconds and call this action will re-calculate the execution time. _bind = const (EL, Binding) => { the let debounceMillisecond = parseFloat (binding.arg) debounceMillisecond = debounceMillisecond> 0 debounceMillisecond:? 300 // Debounce debounce three parameters / * * 1.binding.value binding element * 2 free time, seemingly is performed after the number of seconds * 3 configuration parameters. * / el._v_resize = Debounce (binding.value, debounceMillisecond, { 'leading': to true , //Before the time out 'trailing': to true // after a timeout }) } Export default { the bind (EL, Binding) { _bind (EL, Binding) // the Scroll Strategy IE9 IT IS ON Will Not Supported Object Strategy Change to Automatically.. // for compatibility IE9 el._v_resize_detector = el._v_resize_detector || elementResizeDetector ({Strategy: 'Scroll' }) // listening el width and height el._v_resize_detector.listenTo (el, Element => { el._v_resize ({ width: el .offsetWidth, height: el.offsetHeight }) }) }, update (el, binding) { if (binding.value !== binding.oldValue) { delete el._v_resize _bind(el, binding) } }, unbind (el, binding) { el._v_resize_detector.uninstall(el) delete el._v_resize_detector delete el._v_resize } }
Custom use
Outermost div height to height: 100%