pure-scroll
Version:
一个简洁且好用的滚动库, 基于better-scroll封装
22 lines (18 loc) • 344 B
JavaScript
/**
* event事件绑定和取消
*/
import { on, off } from '../utils/event';
export function BindEventMixin (eventFn) {
function bind () {
eventFn.call(this, on);
}
function unbind () {
eventFn.call(this, off);
}
return {
mounted: bind,
activated: bind,
deactivated: unbind,
beforeDestroy: unbind
};
}