tdesign-mobile-vue
Version:
tdesign-mobile-vue
35 lines (32 loc) • 962 B
JavaScript
/**
* tdesign v1.7.0
* (c) 2024 TDesign Group
* @license MIT
*/
var Hover = {
created: function created(el, binding) {
var startTime = 50;
var stayTime = 70;
var _binding$value = binding.value,
className = _binding$value.className,
_binding$value$disabl = _binding$value.disabledHover,
disabledHover = _binding$value$disabl === void 0 ? false : _binding$value$disabl;
el.addEventListener("touchstart", function () {
if (disabledHover) return;
setTimeout(function () {
el === null || el === void 0 || el.classList.add(className);
}, startTime);
}, {
capture: false,
passive: true
});
el.addEventListener("touchend", function () {
if (disabledHover) return;
setTimeout(function () {
el === null || el === void 0 || el.classList.remove(className);
}, stayTime);
}, false);
}
};
export { Hover as default };
//# sourceMappingURL=hover.js.map