Download Fore_End/cpcn2/node_modules/element-ui/lib/directives/repeat-click.js from zxy0307/JavaWeb: direct link, hf CLI and curl.
- Browser
- Download file 729 Bytes
-
https://huggingface.co/zxy0307/JavaWeb/resolve/main/Fore_End/cpcn2/node_modules/element-ui/lib/directives/repeat-click.js
- Command line
-
hf download hf://zxy0307/JavaWeb/Fore_End/cpcn2/node_modules/element-ui/lib/directives/repeat-click.js
-
curl -L -o repeat-click.js https://huggingface.co/zxy0307/JavaWeb/resolve/main/Fore_End/cpcn2/node_modules/element-ui/lib/directives/repeat-click.js
729 Bytes
| ; | |
| exports.__esModule = true; | |
| var _dom = require('element-ui/lib/utils/dom'); | |
| exports.default = { | |
| bind: function bind(el, binding, vnode) { | |
| var interval = null; | |
| var startTime = void 0; | |
| var handler = function handler() { | |
| return vnode.context[binding.expression].apply(); | |
| }; | |
| var clear = function clear() { | |
| if (Date.now() - startTime < 100) { | |
| handler(); | |
| } | |
| clearInterval(interval); | |
| interval = null; | |
| }; | |
| (0, _dom.on)(el, 'mousedown', function (e) { | |
| if (e.button !== 0) return; | |
| startTime = Date.now(); | |
| (0, _dom.once)(document, 'mouseup', clear); | |
| clearInterval(interval); | |
| interval = setInterval(handler, 100); | |
| }); | |
| } | |
| }; |