1234567891011121314151617181920212223242526272829303132 |
- // Types
- function mounted(el, binding) {
- const handler = binding.value;
- const options = {
- passive: !binding.modifiers?.active
- };
- window.addEventListener('resize', handler, options);
- el._onResize = Object(el._onResize);
- el._onResize[binding.instance.$.uid] = {
- handler,
- options
- };
- if (!binding.modifiers?.quiet) {
- handler();
- }
- }
- function unmounted(el, binding) {
- if (!el._onResize?.[binding.instance.$.uid]) return;
- const {
- handler,
- options
- } = el._onResize[binding.instance.$.uid];
- window.removeEventListener('resize', handler, options);
- delete el._onResize[binding.instance.$.uid];
- }
- export const Resize = {
- mounted,
- unmounted
- };
- export default Resize;
- //# sourceMappingURL=index.mjs.map
|