A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://unpkg.com/vue3-lazyload below:

/*! * Vue3-Lazyload.js v0.3.8 * A Vue3.x image lazyload plugin * (c) 2023 MuRong * Released under the MIT License. */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VueLazyload={},e.vue)}(this,function(e,n){"use strict";var s,t;(t=s=s||{}).LOADING="loading",t.LOADED="loaded",t.ERROR="error";const r="undefined"!=typeof window&&null!==window,l=function(){if(r&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)return"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get(){return 0 {this._logger("Not support IntersectionObserver!")})),this._initIntersectionObserver(e,t,o,n,i))}update(e,t){var r,o,n;e&&(null!=(r=this._realObserver(e))&&r.unobserve(e),{src:r,error:t,lifecycle:o,delay:n}=this._valueFormatter("string"==typeof t?t:t.value),this._initIntersectionObserver(e,r,t,o,n))}unmount(e){var t;e&&(null!=(t=this._realObserver(e))&&t.unobserve(e),this._images.delete(e))}loadImages(e,t,r,o){this._setImageSrc(e,t,r,o)}_setImageSrc(t,r,o,n){"img"===t.tagName.toLowerCase()?(r&&t.getAttribute("src")!==r&&t.setAttribute("src",r),this._listenImageStatus(t,()=>{this._lifecycle(s.LOADED,n,t)},()=>{var e;t.onload=null,this._lifecycle(s.ERROR,n,t),null!=(e=this._realObserver(t))&&e.disconnect(),o&&t.getAttribute("src")!==o&&t.setAttribute("src",o),this._log(()=>{this._logger(`Image failed to load!And failed src was: ${r} `)})})):t.style.backgroundImage=`url('${r}')`}_initIntersectionObserver(t,r,o,n,i){var e=this.options.observerOptions;this._images.set(t,new IntersectionObserver(e=>{Array.prototype.forEach.call(e,e=>{i&&0 {this._intersectionCallback(e,t,o,n,i),t.target.removeAttribute(c)},r),t.target.setAttribute(c,String(r))):t.target.hasAttribute(c)&&(clearTimeout(Number(t.target.getAttribute(c))),t.target.removeAttribute(c))}_listenImageStatus(e,t,r){e.onload=t,e.onerror=r}_valueFormatter(e){let t=e,r=this.options.loading,o=this.options.error,n=this.options.lifecycle,i=this.options.delay;return g(e)&&(t=e.src,r=e.loading||this.options.loading,o=e.error||this.options.error,n=e.lifecycle||this.options.lifecycle,i=e.delay||this.options.delay),{src:t,loading:r,error:o,lifecycle:n,delay:i}}_log(e){this.options.log&&e()}_lifecycle(e,t,r){switch(e){case s.LOADING:null!=r&&r.setAttribute("lazy",s.LOADING),null!=t&&t.loading&&t.loading(r);break;case s.LOADED:null!=r&&r.setAttribute("lazy",s.LOADED),null!=t&&t.loaded&&t.loaded(r);break;case s.ERROR:null!=r&&r.setAttribute("lazy",s.ERROR),null!=t&&t.error&&t.error(r)}}_realObserver(e){return this._images.get(e)}_logger(e,...t){let r=console.error;switch(this.options.logLevel){case"error":r=console.error;break;case"warn":r=console.warn;break;case"info":r=console.info;break;case"debug":r=console.debug}r(e,t)}}e.default={install(e,t){const r=new i(t);e.config.globalProperties.$Lazyload=r,e.provide("Lazyload",r),e.directive("lazy",{mounted:r.mount.bind(r),updated:r.update.bind(r),unmounted:r.unmount.bind(r)})}},e.useLazyload=function(t,e){const r=n.ref(null),o=new i(e);return n.onMounted(()=>{r.value&&o.mount(r.value,t.value)}),n.onUnmounted(()=>{r.value&&o.unmount(r.value)}),n.watch(t,e=>{t.value&&o.update(r.value,e)}),r},Object.defineProperty(e,"__esModule",{value:!0})});

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4