This commit is contained in:
2023-08-11 10:45:20 +08:00
commit 161ca982f3
31850 changed files with 2706500 additions and 0 deletions

36
node_modules/vant/lib/mixins/bind-event.js generated vendored Normal file
View File

@ -0,0 +1,36 @@
"use strict";
exports.__esModule = true;
exports.BindEventMixin = BindEventMixin;
var _event = require("../utils/dom/event");
/**
* Bind event when mounted or activated
*/
var uid = 0;
function BindEventMixin(handler) {
var key = "binded_" + uid++;
function bind() {
if (!this[key]) {
handler.call(this, _event.on, true);
this[key] = true;
}
}
function unbind() {
if (this[key]) {
handler.call(this, _event.off, false);
this[key] = false;
}
}
return {
mounted: bind,
activated: bind,
deactivated: unbind,
beforeDestroy: unbind
};
}