zcloud-ui
Version:
A Component Library for Vue.js.
21 lines (17 loc) • 463 B
JavaScript
;
exports.__esModule = true;
var _lodash = require('lodash');
var height = 0;
var myUpdate = function myUpdate(el, binding, vnode) {
var style = document.defaultView.getComputedStyle(el);
if (height !== style.height) {
binding.value(); // 关键
height = style.height;
}
};
var debounceFunc = (0, _lodash.debounce)(myUpdate, 200);
exports.default = {
update: function update() {
debounceFunc.apply(undefined, arguments);
}
};