tdesign-mobile-vue
Version:
tdesign-mobile-vue
45 lines (41 loc) • 1.28 kB
JavaScript
/**
* tdesign v1.9.3
* (c) 2025 TDesign Group
* @license MIT
*/
import { _ as _classCallCheck, a as _createClass } from '../../_chunks/dep-15aa73f9.mjs';
import { _ as _defineProperty } from '../../_chunks/dep-900db0e1.mjs';
import '../../_chunks/dep-4915223e.mjs';
var MockIntersectionObserver = /*#__PURE__*/function () {
function MockIntersectionObserver(callback) {
var _this = this;
_classCallCheck(this, MockIntersectionObserver);
_defineProperty(this, "_callback", void 0);
_defineProperty(this, "_element", void 0);
_defineProperty(this, "trigger", function (event) {
_this._callback([{
isIntersecting: true
}]);
});
this._callback = callback;
}
return _createClass(MockIntersectionObserver, [{
key: "observe",
value: function observe(element) {
this._element = element;
this._element.addEventListener("resize", this.trigger);
}
}, {
key: "unobserve",
value: function unobserve() {
this._element.removeEventListener("resize", this.trigger);
}
}, {
key: "disconnect",
value: function disconnect() {
this._element.removeEventListener("resize", this.trigger);
}
}]);
}();
export { MockIntersectionObserver };
//# sourceMappingURL=utils.mjs.map