@nutui/nutui 2.3.13 → 2.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/.DS_Store +0 -0
- package/dist/nutui.css +1 -1
- package/dist/nutui.js +2380 -518
- package/dist/nutui.js.map +1 -1
- package/dist/nutui.min.css +1 -1
- package/dist/nutui.min.js +3 -3
- package/dist/nutui.min.js.map +1 -1
- package/dist/packages/.DS_Store +0 -0
- package/dist/packages/actionsheet/actionsheet.css +1 -1
- package/dist/packages/actionsheet/actionsheet.js +2 -2
- package/dist/packages/actionsheet/actionsheet.js.map +1 -1
- package/dist/packages/address/address.css +1 -1
- package/dist/packages/address/address.js +2 -2
- package/dist/packages/address/address.js.map +1 -1
- package/dist/packages/avatar/avatar.css +1 -1
- package/dist/packages/avatar/avatar.js +2 -2
- package/dist/packages/avatar/avatar.js.map +1 -1
- package/dist/packages/backtop/backtop.css +1 -1
- package/dist/packages/backtop/backtop.js +2 -2
- package/dist/packages/backtop/backtop.js.map +1 -1
- package/dist/packages/badge/badge.css +1 -1
- package/dist/packages/badge/badge.js +2 -2
- package/dist/packages/badge/badge.js.map +1 -1
- package/dist/packages/button/button.css +1 -1
- package/dist/packages/button/button.js +2 -2
- package/dist/packages/button/button.js.map +1 -1
- package/dist/packages/buttongroup/buttongroup.css +1 -1
- package/dist/packages/buttongroup/buttongroup.js +2 -2
- package/dist/packages/buttongroup/buttongroup.js.map +1 -1
- package/dist/packages/calendar/calendar.css +1 -1
- package/dist/packages/calendar/calendar.js +2 -2
- package/dist/packages/calendar/calendar.js.map +1 -1
- package/dist/packages/cell/cell.css +1 -1
- package/dist/packages/cell/cell.js +2 -2
- package/dist/packages/cell/cell.js.map +1 -1
- package/dist/packages/checkbox/checkbox.css +1 -1
- package/dist/packages/checkbox/checkbox.js +2 -2
- package/dist/packages/checkbox/checkbox.js.map +1 -1
- package/dist/packages/checkboxgroup/checkboxgroup.css +1 -1
- package/dist/packages/checkboxgroup/checkboxgroup.js +2 -2
- package/dist/packages/checkboxgroup/checkboxgroup.js.map +1 -1
- package/dist/packages/checkboxgroup/checkboxgroup.vue +6 -1
- package/dist/packages/circleprogress/circleprogress.css +1 -1
- package/dist/packages/circleprogress/circleprogress.js +2 -2
- package/dist/packages/circleprogress/circleprogress.js.map +1 -1
- package/dist/packages/col/col.css +1 -1
- package/dist/packages/col/col.js +2 -2
- package/dist/packages/col/col.js.map +1 -1
- package/dist/packages/collapse/collapse.css +1 -1
- package/dist/packages/collapse/collapse.js +2 -2
- package/dist/packages/collapse/collapse.js.map +1 -1
- package/dist/packages/collapseitem/collapseitem.css +1 -1
- package/dist/packages/collapseitem/collapseitem.js +2 -2
- package/dist/packages/collapseitem/collapseitem.js.map +1 -1
- package/dist/packages/collapseitem/collapseitem.vue +14 -2
- package/dist/packages/countdown/countdown.css +1 -1
- package/dist/packages/countdown/countdown.js +2 -2
- package/dist/packages/countdown/countdown.js.map +1 -1
- package/dist/packages/countup/countup.css +1 -1
- package/dist/packages/countup/countup.js +2 -2
- package/dist/packages/countup/countup.js.map +1 -1
- package/dist/packages/coupon/coupon.css +1 -1
- package/dist/packages/coupon/coupon.js +2 -2
- package/dist/packages/coupon/coupon.js.map +1 -1
- package/dist/packages/datepicker/datepicker.css +1 -1
- package/dist/packages/datepicker/datepicker.js +2 -2
- package/dist/packages/datepicker/datepicker.js.map +1 -1
- package/dist/packages/dialog/dialog.css +1 -1
- package/dist/packages/dialog/dialog.js +2 -2
- package/dist/packages/dialog/dialog.js.map +1 -1
- package/dist/packages/drag/drag.css +1 -1
- package/dist/packages/drag/drag.js +2 -2
- package/dist/packages/drag/drag.js.map +1 -1
- package/dist/packages/elevator/elevator.css +1 -1
- package/dist/packages/elevator/elevator.js +2 -2
- package/dist/packages/elevator/elevator.js.map +1 -1
- package/dist/packages/fixednav/fixednav.css +1 -1
- package/dist/packages/fixednav/fixednav.js +2 -2
- package/dist/packages/fixednav/fixednav.js.map +1 -1
- package/dist/packages/flex/flex.css +1 -1
- package/dist/packages/flex/flex.js +2 -2
- package/dist/packages/flex/flex.js.map +1 -1
- package/dist/packages/icon/icon.css +1 -1
- package/dist/packages/icon/icon.js +2 -2
- package/dist/packages/icon/icon.js.map +1 -1
- package/dist/packages/imagepicker/imagepicker.css +1 -1
- package/dist/packages/imagepicker/imagepicker.js +2 -2
- package/dist/packages/imagepicker/imagepicker.js.map +1 -1
- package/dist/packages/infiniteloading/infiniteloading.css +1 -1
- package/dist/packages/infiniteloading/infiniteloading.js +2 -2
- package/dist/packages/infiniteloading/infiniteloading.js.map +1 -1
- package/dist/packages/lazyload/lazyload.css +1 -1
- package/dist/packages/lazyload/lazyload.js +3 -3
- package/dist/packages/lazyload/lazyload.js.map +1 -1
- package/dist/packages/leftslip/leftslip.css +1 -1
- package/dist/packages/leftslip/leftslip.js +2 -2
- package/dist/packages/leftslip/leftslip.js.map +1 -1
- package/dist/packages/luckdraw/luckdraw.css +1 -1
- package/dist/packages/luckdraw/luckdraw.js +2 -2
- package/dist/packages/luckdraw/luckdraw.js.map +1 -1
- package/dist/packages/luckycard/luckycard.css +1 -1
- package/dist/packages/luckycard/luckycard.js +2 -2
- package/dist/packages/luckycard/luckycard.js.map +1 -1
- package/dist/packages/magic/magic.css +1 -1
- package/dist/packages/magic/magic.js +2 -2
- package/dist/packages/magic/magic.js.map +1 -1
- package/dist/packages/menu/menu.css +1 -1
- package/dist/packages/menu/menu.js +2 -2
- package/dist/packages/menu/menu.js.map +1 -1
- package/dist/packages/navbar/navbar.css +1 -1
- package/dist/packages/navbar/navbar.js +2 -2
- package/dist/packages/navbar/navbar.js.map +1 -1
- package/dist/packages/ninegrid/ninegrid.css +1 -1
- package/dist/packages/ninegrid/ninegrid.js +2 -2
- package/dist/packages/ninegrid/ninegrid.js.map +1 -1
- package/dist/packages/noticebar/noticebar.css +1 -1
- package/dist/packages/noticebar/noticebar.js +2 -2
- package/dist/packages/noticebar/noticebar.js.map +1 -1
- package/dist/packages/notify/notify.css +1 -1
- package/dist/packages/notify/notify.js +2 -2
- package/dist/packages/notify/notify.js.map +1 -1
- package/dist/packages/numberkeyboard/numberkeyboard.css +1 -1
- package/dist/packages/numberkeyboard/numberkeyboard.js +2 -2
- package/dist/packages/numberkeyboard/numberkeyboard.js.map +1 -1
- package/dist/packages/picker/picker.css +1 -1
- package/dist/packages/picker/picker.js +2 -2
- package/dist/packages/picker/picker.js.map +1 -1
- package/dist/packages/popup/popup.css +1 -1
- package/dist/packages/popup/popup.js +2 -2
- package/dist/packages/popup/popup.js.map +1 -1
- package/dist/packages/price/price.css +1 -1
- package/dist/packages/price/price.js +2 -2
- package/dist/packages/price/price.js.map +1 -1
- package/dist/packages/progress/progress.css +1 -1
- package/dist/packages/progress/progress.js +2 -2
- package/dist/packages/progress/progress.js.map +1 -1
- package/dist/packages/radio/radio.css +1 -1
- package/dist/packages/radio/radio.js +2 -2
- package/dist/packages/radio/radio.js.map +1 -1
- package/dist/packages/radiogroup/radiogroup.css +1 -1
- package/dist/packages/radiogroup/radiogroup.js +2 -2
- package/dist/packages/radiogroup/radiogroup.js.map +1 -1
- package/dist/packages/range/range.css +1 -1
- package/dist/packages/range/range.js +2 -2
- package/dist/packages/range/range.js.map +1 -1
- package/dist/packages/rate/rate.css +1 -1
- package/dist/packages/rate/rate.js +2 -2
- package/dist/packages/rate/rate.js.map +1 -1
- package/dist/packages/row/row.css +1 -1
- package/dist/packages/row/row.js +2 -2
- package/dist/packages/row/row.js.map +1 -1
- package/dist/packages/scroller/scroller.css +1 -1
- package/dist/packages/scroller/scroller.js +2 -2
- package/dist/packages/scroller/scroller.js.map +1 -1
- package/dist/packages/searchbar/searchbar.css +1 -1
- package/dist/packages/searchbar/searchbar.js +2 -2
- package/dist/packages/searchbar/searchbar.js.map +1 -1
- package/dist/packages/shortpassword/shortpassword.css +1 -1
- package/dist/packages/shortpassword/shortpassword.js +2 -2
- package/dist/packages/shortpassword/shortpassword.js.map +1 -1
- package/dist/packages/sidenavbar/sidenavbar.css +1 -1
- package/dist/packages/sidenavbar/sidenavbar.js +2 -2
- package/dist/packages/sidenavbar/sidenavbar.js.map +1 -1
- package/dist/packages/sidenavbaritem/sidenavbaritem.css +1 -1
- package/dist/packages/sidenavbaritem/sidenavbaritem.js +2 -2
- package/dist/packages/sidenavbaritem/sidenavbaritem.js.map +1 -1
- package/dist/packages/signature/signature.css +1 -1
- package/dist/packages/signature/signature.js +2 -2
- package/dist/packages/signature/signature.js.map +1 -1
- package/dist/packages/skeleton/skeleton.css +1 -1
- package/dist/packages/skeleton/skeleton.js +2 -2
- package/dist/packages/skeleton/skeleton.js.map +1 -1
- package/dist/packages/slider/slider.css +1 -1
- package/dist/packages/slider/slider.js +2 -2
- package/dist/packages/slider/slider.js.map +1 -1
- package/dist/packages/stepper/stepper.css +1 -1
- package/dist/packages/stepper/stepper.js +2 -2
- package/dist/packages/stepper/stepper.js.map +1 -1
- package/dist/packages/steps/steps.css +1 -1
- package/dist/packages/steps/steps.js +2 -2
- package/dist/packages/steps/steps.js.map +1 -1
- package/dist/packages/subsidenavbar/subsidenavbar.css +1 -1
- package/dist/packages/subsidenavbar/subsidenavbar.js +2 -2
- package/dist/packages/subsidenavbar/subsidenavbar.js.map +1 -1
- package/dist/packages/swiper/swiper.css +1 -1
- package/dist/packages/swiper/swiper.js +2 -2
- package/dist/packages/swiper/swiper.js.map +1 -1
- package/dist/packages/switch/switch.css +1 -1
- package/dist/packages/switch/switch.js +2 -2
- package/dist/packages/switch/switch.js.map +1 -1
- package/dist/packages/tab/tab.css +1 -1
- package/dist/packages/tab/tab.js +2 -2
- package/dist/packages/tab/tab.js.map +1 -1
- package/dist/packages/tabbar/tabbar.css +1 -1
- package/dist/packages/tabbar/tabbar.js +2 -2
- package/dist/packages/tabbar/tabbar.js.map +1 -1
- package/dist/packages/tabpanel/tabpanel.css +1 -1
- package/dist/packages/tabpanel/tabpanel.js +2 -2
- package/dist/packages/tabpanel/tabpanel.js.map +1 -1
- package/dist/packages/tabselect/tabselect.css +1 -1
- package/dist/packages/tabselect/tabselect.js +2 -2
- package/dist/packages/tabselect/tabselect.js.map +1 -1
- package/dist/packages/textbox/textbox.css +1 -1
- package/dist/packages/textbox/textbox.js +2 -2
- package/dist/packages/textbox/textbox.js.map +1 -1
- package/dist/packages/textinput/textinput.css +1 -1
- package/dist/packages/textinput/textinput.js +2 -2
- package/dist/packages/textinput/textinput.js.map +1 -1
- package/dist/packages/timeline/timeline.css +1 -1
- package/dist/packages/timeline/timeline.js +2 -2
- package/dist/packages/timeline/timeline.js.map +1 -1
- package/dist/packages/timelineitem/timelineitem.css +1 -1
- package/dist/packages/timelineitem/timelineitem.js +2 -2
- package/dist/packages/timelineitem/timelineitem.js.map +1 -1
- package/dist/packages/toast/toast.css +1 -1
- package/dist/packages/toast/toast.js +2 -2
- package/dist/packages/toast/toast.js.map +1 -1
- package/dist/packages/uploader/uploader.css +1 -1
- package/dist/packages/uploader/uploader.js +2 -2
- package/dist/packages/uploader/uploader.js.map +1 -1
- package/dist/packages/video/video.css +1 -1
- package/dist/packages/video/video.js +2 -2
- package/dist/packages/video/video.js.map +1 -1
- package/package.json +5 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack://[name]/webpack/universalModuleDefinition","webpack://[name]/webpack/bootstrap","webpack://[name]/./node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack://[name]/./src/packages/infiniteloading/infiniteloading.vue?5e38","webpack://[name]/./src/packages/infiniteloading/infiniteloading.vue?4076","webpack://[name]/src/packages/infiniteloading/infiniteloading.vue","webpack://[name]/./src/packages/infiniteloading/infiniteloading.vue","webpack://[name]/./src/packages/infiniteloading/index.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","normalizeComponent","scriptExports","render","staticRenderFns","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","hook","options","_compiled","functional","_scopeId","context","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","_registeredComponents","add","_ssrRegister","$root","$options","shadowRoot","_injectStyles","originalRender","h","existing","beforeCreate","concat","props","hasMore","type","default","isLoading","threshold","useWindow","useCapture","isShowMod","isShowBottomTips","unloadMoreTxt","loadingTxt","scrollChange","containerId","data","startX","startY","diffX","diffY","beforeScrollTop","slotUnloadMore","slotLoading","mounted","scrollEl","methods","touchStartHandle","console","touchMoveHandle","getParentElement","scrollListener","window","requestAniFrame","handleScroll","calculateTopPosition","getWindowScrollTop","isScrollAtBottom","offsetDistance","scrollHeight","clientHeight","scrollTop","resScrollTop","activated","deactivated","destroyed","_vm","_c","_self","ref","staticClass","on","$event","_t","_v","_s","_e","InfiniteLoading","install","Vue","component"],"mappings":";;;;;CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,kBAAmB,GAAIH,GACJ,iBAAZC,QACdA,QAAyB,gBAAID,IAE7BD,EAAsB,gBAAIC,IAR5B,CASoB,oBAATK,KAAuBA,KAAOC,MAAO,WAChD,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUR,QAGnC,IAAIC,EAASK,EAAiBE,GAAY,CACzCC,EAAGD,EACHE,GAAG,EACHV,QAAS,IAUV,OANAW,EAAQH,GAAUI,KAAKX,EAAOD,QAASC,EAAQA,EAAOD,QAASO,GAG/DN,EAAOS,GAAI,EAGJT,EAAOD,QA0Df,OArDAO,EAAoBM,EAAIF,EAGxBJ,EAAoBO,EAAIR,EAGxBC,EAAoBQ,EAAI,SAASf,EAASgB,EAAMC,GAC3CV,EAAoBW,EAAElB,EAASgB,IAClCG,OAAOC,eAAepB,EAASgB,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+G,IAGvBA","file":"infiniteloading/infiniteloading.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"infiniteloading\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"infiniteloading\"] = factory();\n\telse\n\t\troot[\"infiniteloading\"] = factory();\n})((typeof self !== 'undefined' ? self : this), function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 191);\n","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent(\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */,\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options =\n typeof scriptExports === 'function' ? scriptExports.options : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) {\n // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () {\n injectStyles.call(\n this,\n (options.functional ? this.parent : this).$root.$options.shadowRoot\n )\n }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functional component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{ref:\"scroller\",staticClass:\"nut-infiniteloading\",on:{\"touchstart\":function($event){return _vm.touchStartHandle($event)},\"touchmove\":function($event){return _vm.touchMoveHandle($event)}}},[_vm._t(\"default\"),_vm._v(\" \"),_c('div',{staticClass:\"load-more\"},[(_vm.isShowBottomTips)?_c('div',{staticClass:\"bottom-tips\"},[(_vm.isLoading)?[(!_vm.slotLoading)?[_c('i',{staticClass:\"loading-hint\"}),_c('span',{staticClass:\"loading-txt\"},[_vm._v(_vm._s(_vm.loadingTxt))])]:_vm._t(\"loading\")]:(!_vm.hasMore)?[(!_vm.slotUnloadMore)?_c('span',{staticClass:\"tips-txt\"},[_vm._v(_vm._s(_vm.unloadMoreTxt))]):_vm._t(\"unloadMore\")]:_vm._e()],2):_vm._e()])],2)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./infiniteloading.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./infiniteloading.vue?vue&type=script&lang=js&\"","<template>\n <div class=\"nut-infiniteloading\" ref=\"scroller\" @touchstart=\"touchStartHandle($event)\" @touchmove=\"touchMoveHandle($event)\">\n <slot></slot>\n <div class=\"load-more\">\n <div class=\"bottom-tips\" v-if=\"isShowBottomTips\">\n <template v-if=\"isLoading\">\n <template v-if=\"!slotLoading\"> <i class=\"loading-hint\"></i><span class=\"loading-txt\">{{loadingTxt}}</span> </template>\n <slot name=\"loading\" v-else></slot>\n </template>\n\n <template v-else-if=\"!hasMore\">\n <span class=\"tips-txt\" v-if=\"!slotUnloadMore\">{{ unloadMoreTxt }}</span>\n <slot name=\"unloadMore\" v-else></slot>\n </template>\n </div>\n </div>\n </div>\n</template>\n<script>\nexport default {\n name: 'nut-infiniteloading',\n props: {\n hasMore: {\n type: Boolean,\n default: true\n },\n isLoading: {\n type: Boolean,\n default: false\n },\n threshold: {\n type: Number,\n default: 200\n },\n useWindow: {\n type: Boolean,\n default: true\n },\n useCapture: {\n type: Boolean,\n default: false\n },\n isShowMod: {\n type: Boolean,\n default: false\n },\n isShowBottomTips: {\n type: Boolean,\n default: true\n },\n unloadMoreTxt: {\n type: String,\n default: '哎呀,这里是底部了啦'\n },\n loadingTxt: {\n type: String,\n default: '加载中...'\n },\n scrollChange: {\n type: Function\n },\n containerId: {\n type: String,\n default: ''\n }\n },\n data() {\n return {\n startX: 0,\n startY: 0,\n diffX: 0,\n diffY: 0,\n beforeScrollTop: 0,\n slotUnloadMore: false,\n slotLoading: false\n };\n },\n\n mounted: function() {\n const parentElement = this.getParentElement(this.$el);\n let scrollEl = window;\n if (this.useWindow === false) {\n scrollEl = parentElement;\n }\n this.scrollEl = scrollEl;\n this.scrollListener();\n\n this.slotUnloadMore = this.$slots.unloadMore ? true : false;\n this.slotLoading = this.$slots.loading ? true : false;\n },\n\n methods: {\n touchStartHandle(e) {\n try {\n this.startX = Number(e.changedTouches[0].pageX);\n this.startY = Number(e.changedTouches[0].pageY);\n } catch (e) {\n console.log(e.message);\n }\n },\n touchMoveHandle(e) {\n let endX = Number(e.changedTouches[0].pageX);\n let endY = Number(e.changedTouches[0].pageY);\n this.diffX = endX - this.startX;\n this.diffY = endY - this.startY;\n },\n getParentElement(el) {\n if (this.containerId) {\n return document.querySelector(`#${this.containerId}`);\n }\n return el && el.parentNode;\n },\n scrollListener() {\n this.scrollEl.addEventListener('scroll', this.handleScroll, this.useCapture);\n window.addEventListener('resize', this.handleScroll, this.useCapture);\n },\n\n requestAniFrame() {\n return (\n window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n function(callback) {\n window.setTimeout(callback, 1000 / 60);\n }\n );\n },\n\n handleScroll() {\n this.requestAniFrame()(() => {\n if (!this.isScrollAtBottom() || !this.hasMore || this.isLoading || !this.isShowMod) {\n return false;\n } else {\n this.$emit('loadmore');\n }\n });\n },\n\n calculateTopPosition(el) {\n if (!el) {\n return 0;\n }\n return el.offsetTop + this.calculateTopPosition(el.offsetParent);\n },\n\n getWindowScrollTop() {\n return window.pageYOffset !== undefined\n ? window.pageYOffset\n : (document.documentElement || document.body.parentNode || document.body).scrollTop;\n },\n\n isScrollAtBottom() {\n let offsetDistance;\n\n let resScrollTop = 0;\n\n const windowScrollTop = this.getWindowScrollTop();\n\n if (this.useWindow) {\n offsetDistance = this.calculateTopPosition(this.$refs.scroller) + this.$refs.scroller.offsetHeight - windowScrollTop - window.innerHeight;\n } else {\n const { scrollHeight, clientHeight, scrollTop } = this.scrollEl;\n\n offsetDistance = scrollHeight - clientHeight - scrollTop;\n resScrollTop = scrollTop;\n }\n this.$emit('scrollChange', this.useWindow ? windowScrollTop : resScrollTop);\n // 保证是往下滑动的\n let beforeScrollTop = this.beforeScrollTop;\n this.beforeScrollTop = windowScrollTop;\n\n return offsetDistance <= this.threshold && windowScrollTop >= this.beforeScrollTop;\n }\n },\n\n activated() {\n if (this.keepAlive) {\n this.keepAlive = false;\n this.scrollListener();\n }\n },\n\n deactivated() {\n this.keepAlive = true;\n this.scrollEl.removeEventListener('scroll', this.handleScroll, this.useCapture);\n window.removeEventListener('resize', this.handleScroll, this.useCapture);\n },\n\n destroyed() {\n this.scrollEl.removeEventListener('scroll', this.handleScroll, this.useCapture);\n window.removeEventListener('resize', this.handleScroll, this.useCapture);\n }\n};\n</script>\n","import { render, staticRenderFns } from \"./infiniteloading.vue?vue&type=template&id=48fb25f8&\"\nimport script from \"./infiniteloading.vue?vue&type=script&lang=js&\"\nexport * from \"./infiniteloading.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import InfiniteLoading from './infiniteloading.vue';\nimport './infiniteloading.scss';\n\nInfiniteLoading.install = function(Vue) {\n Vue.component(InfiniteLoading.name, InfiniteLoading);\n};\n\nexport default InfiniteLoading;\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack://[name]/webpack/universalModuleDefinition","webpack://[name]/webpack/bootstrap","webpack://[name]/./node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack://[name]/./src/packages/infiniteloading/infiniteloading.vue?e064","webpack://[name]/./src/packages/infiniteloading/infiniteloading.vue?4076","webpack://[name]/src/packages/infiniteloading/infiniteloading.vue","webpack://[name]/./src/packages/infiniteloading/infiniteloading.vue","webpack://[name]/./src/packages/infiniteloading/index.js"],"names":["root","factory","exports","module","define","amd","self","this","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","normalizeComponent","scriptExports","render","staticRenderFns","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","hook","options","_compiled","functional","_scopeId","context","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","_registeredComponents","add","_ssrRegister","$root","$options","shadowRoot","_injectStyles","originalRender","h","existing","beforeCreate","concat","props","hasMore","type","Boolean","default","isLoading","threshold","Number","useWindow","useCapture","isShowMod","isShowBottomTips","unloadMoreTxt","String","loadingTxt","scrollChange","Function","containerId","data","startX","startY","diffX","diffY","beforeScrollTop","slotUnloadMore","slotLoading","mounted","parentElement","getParentElement","$el","scrollEl","window","scrollListener","$slots","unloadMore","loading","methods","touchStartHandle","e","changedTouches","pageX","pageY","console","log","message","touchMoveHandle","endX","endY","el","document","querySelector","parentNode","addEventListener","handleScroll","requestAniFrame","requestAnimationFrame","webkitRequestAnimationFrame","mozRequestAnimationFrame","callback","setTimeout","_this","isScrollAtBottom","$emit","calculateTopPosition","offsetTop","offsetParent","getWindowScrollTop","undefined","pageYOffset","documentElement","body","scrollTop","offsetDistance","resScrollTop","windowScrollTop","$refs","scroller","offsetHeight","innerHeight","_this$scrollEl","scrollHeight","clientHeight","activated","keepAlive","deactivated","removeEventListener","destroyed","_vm","_h","$createElement","_c","_self","ref","staticClass","on","$event","_t","_v","_s","_e","InfiniteLoading","install","Vue","component"],"mappings":";;;;;CAAA,SAA2CA,EAAMC,GAC1B,iBAAZC,SAA0C,iBAAXC,OACxCA,OAAOD,QAAUD,IACQ,mBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,kBAAmB,GAAIH,GACJ,iBAAZC,QACdA,QAAyB,gBAAID,IAE7BD,EAAsB,gBAAIC,IAR5B,CASoB,oBAATK,KAAuBA,KAAOC,MAAO,WAChD,O,YCTE,IAAIC,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF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XC,YACd,GHRW,WAAa,IAAI8E,EAAI1J,KAAS2J,EAAGD,EAAIE,eAAmBC,EAAGH,EAAII,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,IAAI,WAAWC,YAAY,sBAAsBC,GAAG,CAAC,WAAa,SAASC,GAAQ,OAAOR,EAAIlD,iBAAiB0D,IAAS,UAAY,SAASA,GAAQ,OAAOR,EAAI1C,gBAAgBkD,MAAW,CAACR,EAAIS,GAAG,WAAWT,EAAIU,GAAG,KAAKP,EAAG,MAAM,CAACG,YAAY,aAAa,CAAEN,EAAoB,iBAAEG,EAAG,MAAM,CAACG,YAAY,eAAe,CAAEN,EAAa,UAAE,CAAGA,EAAI9D,YAA4H8D,EAAIS,GAAG,WAAtH,CAACN,EAAG,IAAI,CAACG,YAAY,iBAAiBH,EAAG,OAAO,CAACG,YAAY,eAAe,CAACN,EAAIU,GAAGV,EAAIW,GAAGX,EAAIzE,iBAAqCyE,EAAItF,QAA8HsF,EAAIY,KAAzH,CAAGZ,EAAI/D,eAAwF+D,EAAIS,GAAG,cAA/EN,EAAG,OAAO,CAACG,YAAY,YAAY,CAACN,EAAIU,GAAGV,EAAIW,GAAGX,EAAI3E,oBAAkD,GAAG2E,EAAIY,QAAQ,KACltB,IGUpB,EACA,KACA,KACA,M,eCXFC,EAAgBC,QAAU,SAASC,GACjCA,EAAIC,UAAUH,EAAgB5J,KAAM4J,IAGvBA","file":"infiniteloading/infiniteloading.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"infiniteloading\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"infiniteloading\"] = factory();\n\telse\n\t\troot[\"infiniteloading\"] = factory();\n})((typeof self !== 'undefined' ? self : this), function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"./\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 193);\n","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent(\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */,\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options =\n typeof scriptExports === 'function' ? scriptExports.options : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) {\n // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () {\n injectStyles.call(\n this,\n (options.functional ? this.parent : this).$root.$options.shadowRoot\n )\n }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functional component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:\"scroller\",staticClass:\"nut-infiniteloading\",on:{\"touchstart\":function($event){return _vm.touchStartHandle($event)},\"touchmove\":function($event){return _vm.touchMoveHandle($event)}}},[_vm._t(\"default\"),_vm._v(\" \"),_c('div',{staticClass:\"load-more\"},[(_vm.isShowBottomTips)?_c('div',{staticClass:\"bottom-tips\"},[(_vm.isLoading)?[(!_vm.slotLoading)?[_c('i',{staticClass:\"loading-hint\"}),_c('span',{staticClass:\"loading-txt\"},[_vm._v(_vm._s(_vm.loadingTxt))])]:_vm._t(\"loading\")]:(!_vm.hasMore)?[(!_vm.slotUnloadMore)?_c('span',{staticClass:\"tips-txt\"},[_vm._v(_vm._s(_vm.unloadMoreTxt))]):_vm._t(\"unloadMore\")]:_vm._e()],2):_vm._e()])],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./infiniteloading.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./infiniteloading.vue?vue&type=script&lang=js&\"","<template>\n <div class=\"nut-infiniteloading\" ref=\"scroller\" @touchstart=\"touchStartHandle($event)\" @touchmove=\"touchMoveHandle($event)\">\n <slot></slot>\n <div class=\"load-more\">\n <div class=\"bottom-tips\" v-if=\"isShowBottomTips\">\n <template v-if=\"isLoading\">\n <template v-if=\"!slotLoading\"> <i class=\"loading-hint\"></i><span class=\"loading-txt\">{{loadingTxt}}</span> </template>\n <slot name=\"loading\" v-else></slot>\n </template>\n\n <template v-else-if=\"!hasMore\">\n <span class=\"tips-txt\" v-if=\"!slotUnloadMore\">{{ unloadMoreTxt }}</span>\n <slot name=\"unloadMore\" v-else></slot>\n </template>\n </div>\n </div>\n </div>\n</template>\n<script>\nexport default {\n name: 'nut-infiniteloading',\n props: {\n hasMore: {\n type: Boolean,\n default: true\n },\n isLoading: {\n type: Boolean,\n default: false\n },\n threshold: {\n type: Number,\n default: 200\n },\n useWindow: {\n type: Boolean,\n default: true\n },\n useCapture: {\n type: Boolean,\n default: false\n },\n isShowMod: {\n type: Boolean,\n default: false\n },\n isShowBottomTips: {\n type: Boolean,\n default: true\n },\n unloadMoreTxt: {\n type: String,\n default: '哎呀,这里是底部了啦'\n },\n loadingTxt: {\n type: String,\n default: '加载中...'\n },\n scrollChange: {\n type: Function\n },\n containerId: {\n type: String,\n default: ''\n }\n },\n data() {\n return {\n startX: 0,\n startY: 0,\n diffX: 0,\n diffY: 0,\n beforeScrollTop: 0,\n slotUnloadMore: false,\n slotLoading: false\n };\n },\n\n mounted: function() {\n const parentElement = this.getParentElement(this.$el);\n let scrollEl = window;\n if (this.useWindow === false) {\n scrollEl = parentElement;\n }\n this.scrollEl = scrollEl;\n this.scrollListener();\n\n this.slotUnloadMore = this.$slots.unloadMore ? true : false;\n this.slotLoading = this.$slots.loading ? true : false;\n },\n\n methods: {\n touchStartHandle(e) {\n try {\n this.startX = Number(e.changedTouches[0].pageX);\n this.startY = Number(e.changedTouches[0].pageY);\n } catch (e) {\n console.log(e.message);\n }\n },\n touchMoveHandle(e) {\n let endX = Number(e.changedTouches[0].pageX);\n let endY = Number(e.changedTouches[0].pageY);\n this.diffX = endX - this.startX;\n this.diffY = endY - this.startY;\n },\n getParentElement(el) {\n if (this.containerId) {\n return document.querySelector(`#${this.containerId}`);\n }\n return el && el.parentNode;\n },\n scrollListener() {\n this.scrollEl.addEventListener('scroll', this.handleScroll, this.useCapture);\n window.addEventListener('resize', this.handleScroll, this.useCapture);\n },\n\n requestAniFrame() {\n return (\n window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n window.mozRequestAnimationFrame ||\n function(callback) {\n window.setTimeout(callback, 1000 / 60);\n }\n );\n },\n\n handleScroll() {\n this.requestAniFrame()(() => {\n if (!this.isScrollAtBottom() || !this.hasMore || this.isLoading || !this.isShowMod) {\n return false;\n } else {\n this.$emit('loadmore');\n }\n });\n },\n\n calculateTopPosition(el) {\n if (!el) {\n return 0;\n }\n return el.offsetTop + this.calculateTopPosition(el.offsetParent);\n },\n\n getWindowScrollTop() {\n return window.pageYOffset !== undefined\n ? window.pageYOffset\n : (document.documentElement || document.body.parentNode || document.body).scrollTop;\n },\n\n isScrollAtBottom() {\n let offsetDistance;\n\n let resScrollTop = 0;\n\n const windowScrollTop = this.getWindowScrollTop();\n\n if (this.useWindow) {\n offsetDistance = this.calculateTopPosition(this.$refs.scroller) + this.$refs.scroller.offsetHeight - windowScrollTop - window.innerHeight;\n } else {\n const { scrollHeight, clientHeight, scrollTop } = this.scrollEl;\n\n offsetDistance = scrollHeight - clientHeight - scrollTop;\n resScrollTop = scrollTop;\n }\n this.$emit('scrollChange', this.useWindow ? windowScrollTop : resScrollTop);\n // 保证是往下滑动的\n let beforeScrollTop = this.beforeScrollTop;\n this.beforeScrollTop = windowScrollTop;\n\n return offsetDistance <= this.threshold && windowScrollTop >= this.beforeScrollTop;\n }\n },\n\n activated() {\n if (this.keepAlive) {\n this.keepAlive = false;\n this.scrollListener();\n }\n },\n\n deactivated() {\n this.keepAlive = true;\n this.scrollEl.removeEventListener('scroll', this.handleScroll, this.useCapture);\n window.removeEventListener('resize', this.handleScroll, this.useCapture);\n },\n\n destroyed() {\n this.scrollEl.removeEventListener('scroll', this.handleScroll, this.useCapture);\n window.removeEventListener('resize', this.handleScroll, this.useCapture);\n }\n};\n</script>\n","import { render, staticRenderFns } from \"./infiniteloading.vue?vue&type=template&id=48fb25f8&\"\nimport script from \"./infiniteloading.vue?vue&type=script&lang=js&\"\nexport * from \"./infiniteloading.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import InfiniteLoading from './infiniteloading.vue';\nimport './infiniteloading.scss';\n\nInfiniteLoading.install = function(Vue) {\n Vue.component(InfiniteLoading.name, InfiniteLoading);\n};\n\nexport default InfiniteLoading;\n"],"sourceRoot":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v2.3.
|
|
2
|
+
* @nutui/nutui v2.3.14 - lazyload.css, ea1cfeedc4af744045aa, Thu Jul 27 2023 18:33:12 GMT+0800 (GMT+08:00)
|
|
3
3
|
* (c) 2017-2020 JDC
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/.lazyloadDemo>div,.lazyloadDemo img{width:100%;background-color:#ddd}.lazyloadDemo>div{height:220px;overflow:hidden;background-size:100% 100%}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @nutui/nutui v2.3.
|
|
2
|
+
* @nutui/nutui v2.3.14 - lazyload.js, ea1cfeedc4af744045aa, Thu Jul 27 2023 18:33:12 GMT+0800 (GMT+08:00)
|
|
3
3
|
* (c) 2017-2020 JDC
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("lazyload",[],e):"object"==typeof exports?exports.lazyload=e():t.lazyload=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="./",r(r.s=
|
|
6
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("lazyload",[],e):"object"==typeof exports?exports.lazyload=e():t.lazyload=e()}("undefined"!=typeof self?self:this,(function(){return function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="./",r(r.s=216)}({129:function(t,e,r){},216:function(t,e,r){"use strict";r.r(e);
|
|
7
7
|
/*!
|
|
8
8
|
* Vue-Lazyload.js v1.3.4
|
|
9
9
|
* (c) 2021 Awe <hilongjw@gmail.com>
|
|
@@ -15,5 +15,5 @@
|
|
|
15
15
|
* Copyright (c) 2014-2015, Jon Schlinkert.
|
|
16
16
|
* Licensed under the MIT License.
|
|
17
17
|
*/
|
|
18
|
-
var i=function(t){return null==t||"function"!=typeof t&&"object"!=typeof t},n=Object.freeze({__proto__:null,default:i,__moduleExports:i}),o=function(t,e){if(null==t)throw new TypeError("expected first argument to be an object.");if(void 0===e||"undefined"==typeof Symbol)return t;if("function"!=typeof Object.getOwnPropertySymbols)return t;for(var r=Object.prototype.propertyIsEnumerable,i=Object(t),n=arguments.length,o=0;++o<n;)for(var s=Object(arguments[o]),a=Object.getOwnPropertySymbols(s),d=0;d<a.length;d++){var l=a[d];r.call(s,l)&&(i[l]=s[l])}return i},s=Object.freeze({__proto__:null,default:o,__moduleExports:o}),a=Object.prototype.toString,d=function(t){var e=typeof t;return"undefined"===e?"undefined":null===t?"null":!0===t||!1===t||t instanceof Boolean?"boolean":"string"===e||t instanceof String?"string":"number"===e||t instanceof Number?"number":"function"===e||t instanceof Function?void 0!==t.constructor.name&&"Generator"===t.constructor.name.slice(0,9)?"generatorfunction":"function":void 0!==Array.isArray&&Array.isArray(t)?"array":t instanceof RegExp?"regexp":t instanceof Date?"date":"[object RegExp]"===(e=a.call(t))?"regexp":"[object Date]"===e?"date":"[object Arguments]"===e?"arguments":"[object Error]"===e?"error":"[object Promise]"===e?"promise":function(t){return t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}(t)?"buffer":"[object Set]"===e?"set":"[object WeakSet]"===e?"weakset":"[object Map]"===e?"map":"[object WeakMap]"===e?"weakmap":"[object Symbol]"===e?"symbol":"[object Map Iterator]"===e?"mapiterator":"[object Set Iterator]"===e?"setiterator":"[object String Iterator]"===e?"stringiterator":"[object Array Iterator]"===e?"arrayiterator":"[object Int8Array]"===e?"int8array":"[object Uint8Array]"===e?"uint8array":"[object Uint8ClampedArray]"===e?"uint8clampedarray":"[object Int16Array]"===e?"int16array":"[object Uint16Array]"===e?"uint16array":"[object Int32Array]"===e?"int32array":"[object Uint32Array]"===e?"uint32array":"[object Float32Array]"===e?"float32array":"[object Float64Array]"===e?"float64array":"object"};var l=Object.freeze({__proto__:null,default:d,__moduleExports:d}),h=n&&i||n,c=s&&o||s,u=l&&d||l;function p(t){t=t||{};var e=arguments.length,r=0;if(1===e)return t;for(;++r<e;){var i=arguments[r];h(t)&&(t=i),b(i)&&f(t,i)}return t}function f(t,e){for(var r in c(t,e),e)if(m(r)&&g(e,r)){var i=e[r];b(i)?("undefined"===u(t[r])&&"function"===u(i)&&(t[r]=i),t[r]=p(t[r]||{},i)):t[r]=i}return t}function b(t){return"object"===u(t)||"function"===u(t)}function g(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function m(t){return"__proto__"!==t&&"constructor"!==t&&"prototype"!==t}var v=p;const y="undefined"!=typeof window&&null!==window,w=function(){if(y&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)return"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}}),!0;return!1}();const _="event",L="observer",E=function(){if(y)return"function"==typeof window.CustomEvent?window.CustomEvent:(t.prototype=window.Event.prototype,t);function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var r=document.createEvent("CustomEvent");return r.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),r}}();function z(t,e){if(!t.length)return;const r=t.indexOf(e);return r>-1?t.splice(r,1):void 0}function j(t,e){if("IMG"!==t.tagName||!t.getAttribute("data-srcset"))return;let r=t.getAttribute("data-srcset");const i=[],n=t.parentNode.offsetWidth*e;let o,s,a;r=r.trim().split(","),r.map(t=>{t=t.trim(),o=t.lastIndexOf(" "),-1===o?(s=t,a=999998):(s=t.substr(0,o),a=parseInt(t.substr(o+1,t.length-o-2),10)),i.push([a,s])}),i.sort((function(t,e){if(t[0]<e[0])return 1;if(t[0]>e[0])return-1;if(t[0]===e[0]){if(-1!==e[1].indexOf(".webp",e[1].length-5))return 1;if(-1!==t[1].indexOf(".webp",t[1].length-5))return-1}return 0}));let d,l="";for(let t=0;t<i.length;t++){d=i[t],l=d[1];const e=i[t+1];if(e&&e[0]<n){l=d[1];break}if(!e){l=d[1];break}}return l}function A(t,e){let r;for(let i=0,n=t.length;i<n;i++)if(e(t[i])){r=t[i];break}return r}const x=(t=1)=>y&&window.devicePixelRatio||t;function O(){if(!y)return!1;let t=!0;try{const e=document.createElement("canvas");e.getContext&&e.getContext("2d")&&(t=0===e.toDataURL("image/webp").indexOf("data:image/webp"))}catch(e){t=!1}return t}const $=function(){if(!y)return;let t=!1;try{let e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e)}catch(t){}return t}(),T={on(t,e,r,i=!1){$?t.addEventListener(e,r,{capture:i,passive:!0}):t.addEventListener(e,r,i)},off(t,e,r,i=!1){t.removeEventListener(e,r,i)}},I=(t,e,r)=>{let i=new Image;if(!t||!t.src){const t=new Error("image src is required");return r(t)}i.src=t.src,t.cors&&(i.crossOrigin=t.cors),i.onload=function(){e({naturalHeight:i.naturalHeight,naturalWidth:i.naturalWidth,src:i.src})},i.onerror=function(t){r(t)}},S=(t,e)=>"undefined"!=typeof getComputedStyle?getComputedStyle(t,null).getPropertyValue(e):t.style[e],C=t=>S(t,"overflow")+S(t,"overflow-y")+S(t,"overflow-x");function H(){}class Q{constructor({max:t}){this.options={max:t||100},this._caches=[]}has(t){return this._caches.indexOf(t)>-1}add(t){this.has(t)||(this._caches.push(t),this._caches.length>this.options.max&&this.free())}free(){this._caches.shift()}}class R{constructor({el:t,src:e,error:r,loading:i,bindType:n,$parent:o,options:s,cors:a,elRenderer:d,imageCache:l}){this.el=t,this.src=e,this.error=r,this.loading=i,this.bindType=n,this.attempt=0,this.cors=a,this.naturalHeight=0,this.naturalWidth=0,this.options=s,this.rect=null,this.$parent=o,this.elRenderer=d,this._imageCache=l,this.performanceData={init:Date.now(),loadStart:0,loadEnd:0},this.filter(),this.initState(),this.render("loading",!1)}initState(){"dataset"in this.el?this.el.dataset.src=this.src:this.el.setAttribute("data-src",this.src),this.state={loading:!1,error:!1,loaded:!1,rendered:!1}}record(t){this.performanceData[t]=Date.now()}update({src:t,loading:e,error:r}){const i=this.src;this.src=t,this.loading=e,this.error=r,this.filter(),i!==this.src&&(this.attempt=0,this.initState())}getRect(){this.rect=this.el.getBoundingClientRect()}checkInView(){return this.getRect(),this.rect.top<window.innerHeight*this.options.preLoad&&this.rect.bottom>this.options.preLoadTop&&this.rect.left<window.innerWidth*this.options.preLoad&&this.rect.right>0}filter(){(function(t){if(!(t instanceof Object))return[];if(Object.keys)return Object.keys(t);{let e=[];for(let r in t)t.hasOwnProperty(r)&&e.push(r);return e}})(this.options.filter).map(t=>{this.options.filter[t](this,this.options)})}renderLoading(t){this.state.loading=!0,I({src:this.loading,cors:this.cors},e=>{this.render("loading",!1),this.state.loading=!1,t()},()=>{t(),this.state.loading=!1,this.options.silent||console.warn(`VueLazyload log: load failed with loading image(${this.loading})`)})}load(t=H){return this.attempt>this.options.attempt-1&&this.state.error?(this.options.silent||console.log(`VueLazyload log: ${this.src} tried too more than ${this.options.attempt} times`),void t()):this.state.rendered&&this.state.loaded?void 0:this._imageCache.has(this.src)?(this.state.loaded=!0,this.render("loaded",!0),this.state.rendered=!0,t()):void this.renderLoading(()=>{this.attempt++,this.options.adapter.beforeLoad&&this.options.adapter.beforeLoad(this,this.options),this.record("loadStart"),I({src:this.src,cors:this.cors},e=>{this.naturalHeight=e.naturalHeight,this.naturalWidth=e.naturalWidth,this.state.loaded=!0,this.state.error=!1,this.record("loadEnd"),this.render("loaded",!1),this.state.rendered=!0,this._imageCache.add(this.src),t()},t=>{!this.options.silent&&console.error(t),this.state.error=!0,this.state.loaded=!1,this.render("error",!1)})})}render(t,e){this.elRenderer(this,t,e)}performance(){let t="loading",e=0;return this.state.loaded&&(t="loaded",e=(this.performanceData.loadEnd-this.performanceData.loadStart)/1e3),this.state.error&&(t="error"),{src:this.src,state:t,time:e}}$destroy(){this.el=null,this.src=null,this.error=null,this.loading=null,this.bindType=null,this.attempt=0}}const k="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",B=["scroll","wheel","mousewheel","resize","animationend","transitionend","touchmove"],P={rootMargin:"0px",threshold:0};function W(t){return class{constructor({preLoad:t,error:e,throttleWait:r,preLoadTop:i,dispatchEvent:n,loading:o,attempt:s,silent:a=!0,scale:d,listenEvents:l,hasbind:h,filter:c,adapter:u,observer:p,observerOptions:f}){this.version='"1.3.4"',this.mode=_,this.ListenerQueue=[],this.TargetIndex=0,this.TargetQueue=[],this.options={silent:a,dispatchEvent:!!n,throttleWait:r||200,preLoad:t||1.3,preLoadTop:i||0,error:e||k,loading:o||k,attempt:s||3,scale:d||x(d),ListenEvents:l||B,hasbind:!1,supportWebp:O(),filter:c||{},adapter:u||{},observer:!!p,observerOptions:f||P},this._initEvent(),this._imageCache=new Q({max:200}),this.lazyLoadHandler=function(t,e){let r=null,i=null,n=0,o=!1;return function(){if(o=!0,r)return;let s=Date.now()-n,a=this,d=arguments,l=function(){n=Date.now(),r=!1,t.apply(a,d)};s>=e?l():r=setTimeout(l,e),o&&(clearTimeout(i),i=setTimeout(l,2*e))}}(this._lazyLoadHandler.bind(this),this.options.throttleWait),this.setMode(this.options.observer?L:_)}config(t={}){v(this.options,t)}performance(){let t=[];return this.ListenerQueue.map(e=>{t.push(e.performance())}),t}addLazyBox(t){this.ListenerQueue.push(t),y&&(this._addListenerTarget(window),this._observer&&this._observer.observe(t.el),t.$el&&t.$el.parentNode&&this._addListenerTarget(t.$el.parentNode))}add(e,r,i){if(function(t,e){let r=!1;for(let i=0,n=t.length;i<n;i++)if(e(t[i])){r=!0;break}return r}(this.ListenerQueue,t=>t.el===e))return this.update(e,r),t.nextTick(this.lazyLoadHandler);let{src:n,loading:o,error:s,cors:a}=this._valueFormatter(r.value);t.nextTick(()=>{n=j(e,this.options.scale)||n,this._observer&&this._observer.observe(e);const d=Object.keys(r.modifiers)[0];let l;d&&(l=i.context.$refs[d],l=l?l.$el||l:document.getElementById(d)),l||(l=(t=>{if(!y)return;if(!(t instanceof HTMLElement))return window;let e=t;for(;e&&e!==document.body&&e!==document.documentElement&&e.parentNode;){if(/(scroll|auto)/.test(C(e)))return e;e=e.parentNode}return window})(e));const h=new R({bindType:r.arg,$parent:l,el:e,loading:o,error:s,src:n,cors:a,elRenderer:this._elRenderer.bind(this),options:this.options,imageCache:this._imageCache});this.ListenerQueue.push(h),y&&(this._addListenerTarget(window),this._addListenerTarget(l)),this.lazyLoadHandler(),t.nextTick(()=>this.lazyLoadHandler())})}update(e,r,i){let{src:n,loading:o,error:s}=this._valueFormatter(r.value);n=j(e,this.options.scale)||n;const a=A(this.ListenerQueue,t=>t.el===e);a?a.update({src:n,loading:o,error:s}):this.add(e,r,i),this._observer&&(this._observer.unobserve(e),this._observer.observe(e)),this.lazyLoadHandler(),t.nextTick(()=>this.lazyLoadHandler())}remove(t){if(!t)return;this._observer&&this._observer.unobserve(t);const e=A(this.ListenerQueue,e=>e.el===t);e&&(this._removeListenerTarget(e.$parent),this._removeListenerTarget(window),z(this.ListenerQueue,e),e.$destroy())}removeComponent(t){t&&(z(this.ListenerQueue,t),this._observer&&this._observer.unobserve(t.el),t.$parent&&t.$el.parentNode&&this._removeListenerTarget(t.$el.parentNode),this._removeListenerTarget(window))}setMode(t){w||t!==L||(t=_),this.mode=t,t===_?(this._observer&&(this.ListenerQueue.forEach(t=>{this._observer.unobserve(t.el)}),this._observer=null),this.TargetQueue.forEach(t=>{this._initListen(t.el,!0)})):(this.TargetQueue.forEach(t=>{this._initListen(t.el,!1)}),this._initIntersectionObserver())}_addListenerTarget(t){if(!t)return;let e=A(this.TargetQueue,e=>e.el===t);return e?e.childrenCount++:(e={el:t,id:++this.TargetIndex,childrenCount:1,listened:!0},this.mode===_&&this._initListen(e.el,!0),this.TargetQueue.push(e)),this.TargetIndex}_removeListenerTarget(t){this.TargetQueue.forEach((e,r)=>{e.el===t&&(e.childrenCount--,e.childrenCount||(this._initListen(e.el,!1),this.TargetQueue.splice(r,1),e=null))})}_initListen(t,e){this.options.ListenEvents.forEach(r=>T[e?"on":"off"](t,r,this.lazyLoadHandler))}_initEvent(){this.Event={listeners:{loading:[],loaded:[],error:[]}},this.$on=(t,e)=>{this.Event.listeners[t]||(this.Event.listeners[t]=[]),this.Event.listeners[t].push(e)},this.$once=(t,e)=>{const r=this;this.$on(t,(function i(){r.$off(t,i),e.apply(r,arguments)}))},this.$off=(t,e)=>{if(e)z(this.Event.listeners[t],e);else{if(!this.Event.listeners[t])return;this.Event.listeners[t].length=0}},this.$emit=(t,e,r)=>{this.Event.listeners[t]&&this.Event.listeners[t].forEach(t=>t(e,r))}}_lazyLoadHandler(){const t=[];this.ListenerQueue.forEach((e,r)=>{e.el&&e.el.parentNode||t.push(e);e.checkInView()&&e.load()}),t.forEach(t=>{z(this.ListenerQueue,t),t.$destroy()})}_initIntersectionObserver(){w&&(this._observer=new IntersectionObserver(this._observerHandler.bind(this),this.options.observerOptions),this.ListenerQueue.length&&this.ListenerQueue.forEach(t=>{this._observer.observe(t.el)}))}_observerHandler(t,e){t.forEach(t=>{t.isIntersecting&&this.ListenerQueue.forEach(e=>{if(e.el===t.target){if(e.state.loaded)return this._observer.unobserve(e.el);e.load()}})})}_elRenderer(t,e,r){if(!t.el)return;const{el:i,bindType:n}=t;let o;switch(e){case"loading":o=t.loading;break;case"error":o=t.error;break;default:o=t.src}if(n?i.style[n]='url("'+o+'")':i.getAttribute("src")!==o&&i.setAttribute("src",o),i.setAttribute("lazy",e),this.$emit(e,t,r),this.options.adapter[e]&&this.options.adapter[e](t,this.options),this.options.dispatchEvent){const r=new E(e,{detail:t});i.dispatchEvent(r)}}_valueFormatter(t){let e=t,r=this.options.loading,i=this.options.error;var n;return null!==(n=t)&&"object"==typeof n&&(t.src||this.options.silent||console.error("Vue Lazyload warning: miss src with "+t),e=t.src,r=t.loading||this.options.loading,i=t.error||this.options.error),{src:e,loading:r,error:i}}}}W.install=(t,e={})=>{const r=new(W(t))(e);"2"===t.version.split(".")[0]?t.directive("lazy",{bind:r.add.bind(r),update:r.update.bind(r),componentUpdated:r.lazyLoadHandler.bind(r),unbind:r.remove.bind(r)}):t.directive("lazy",{bind:r.lazyLoadHandler.bind(r),update(t,e){v(this.vm.$refs,this.vm.$els),r.add(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:t,oldValue:e},{context:this.vm})},unbind(){r.remove(this.el)}})};const D=t=>({props:{tag:{type:String,default:"div"}},render(t){return t(this.tag,null,this.show?this.$slots.default:null)},data:()=>({el:null,state:{loaded:!1},rect:{},show:!1}),mounted(){this.el=this.$el,t.addLazyBox(this),t.lazyLoadHandler()},beforeDestroy(){t.removeComponent(this)},methods:{getRect(){this.rect=this.$el.getBoundingClientRect()},checkInView(){return this.getRect(),y&&this.rect.top<window.innerHeight*t.options.preLoad&&this.rect.bottom>0&&this.rect.left<window.innerWidth*t.options.preLoad&&this.rect.right>0},load(){this.show=!0,this.state.loaded=!0,this.$emit("show",this)},destroy(){return this.$destroy}}});D.install=function(t,e={}){const r=new(W(t))(e);t.component("lazy-component",D(r))};class M{constructor({lazy:t}){this.lazy=t,t.lazyContainerMananger=this,this._queue=[]}bind(t,e,r){const i=new N({el:t,binding:e,vnode:r,lazy:this.lazy});this._queue.push(i)}update(t,e,r){const i=A(this._queue,e=>e.el===t);i&&i.update({el:t,binding:e,vnode:r})}unbind(t,e,r){const i=A(this._queue,e=>e.el===t);i&&(i.clear(),z(this._queue,i))}}const V={selector:"img"};class N{constructor({el:t,binding:e,vnode:r,lazy:i}){this.el=null,this.vnode=r,this.binding=e,this.options={},this.lazy=i,this._queue=[],this.update({el:t,binding:e})}update({el:t,binding:e}){this.el=t,this.options=v({},V,e.value);this.getImgs().forEach(t=>{this.lazy.add(t,v({},this.binding,{value:{src:"dataset"in t?t.dataset.src:t.getAttribute("data-src"),error:("dataset"in t?t.dataset.error:t.getAttribute("data-error"))||this.options.error,loading:("dataset"in t?t.dataset.loading:t.getAttribute("data-loading"))||this.options.loading}}),this.vnode)})}getImgs(){return function(t){let e=t.length;const r=[];for(let i=0;i<e;i++)r.push(t[i]);return r}(this.el.querySelectorAll(this.options.selector))}clear(){this.getImgs().forEach(t=>this.lazy.remove(t)),this.vnode=null,this.binding=null,this.lazy=null}}N.install=(t,e={})=>{const r=new(W(t))(e),i=new N({lazy:r});"2"===t.version.split(".")[0]?t.directive("lazy-container",{bind:i.bind.bind(i),componentUpdated:i.update.bind(i),unbind:i.unbind.bind(i)}):t.directive("lazy-container",{update(t,e){i.update(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:t,oldValue:e},{context:this.vm})},unbind(){i.unbind(this.el)}})};const U=t=>({props:{src:[String,Object],tag:{type:String,default:"img"}},render(t){return t(this.tag,{attrs:{src:this.renderSrc}},this.$slots.default)},data:()=>({el:null,options:{src:"",error:"",loading:"",attempt:t.options.attempt},state:{loaded:!1,error:!1,attempt:0},rect:{},renderSrc:""}),watch:{src(){this.init(),t.addLazyBox(this),t.lazyLoadHandler()}},created(){this.init(),this.renderSrc=this.options.loading},mounted(){this.el=this.$el,t.addLazyBox(this),t.lazyLoadHandler()},beforeDestroy(){t.removeComponent(this)},methods:{init(){const{src:e,loading:r,error:i}=t._valueFormatter(this.src);this.state.loaded=!1,this.options.src=e,this.options.error=i,this.options.loading=r,this.renderSrc=this.options.loading},getRect(){this.rect=this.$el.getBoundingClientRect()},checkInView(){return this.getRect(),y&&this.rect.top<window.innerHeight*t.options.preLoad&&this.rect.bottom>0&&this.rect.left<window.innerWidth*t.options.preLoad&&this.rect.right>0},load(e=H){if(this.state.attempt>this.options.attempt-1&&this.state.error)return t.options.silent||console.log(`VueLazyload log: ${this.options.src} tried too more than ${this.options.attempt} times`),void e();const r=this.options.src;I({src:r},({src:t})=>{this.renderSrc=t,this.state.loaded=!0},t=>{this.state.attempt++,this.renderSrc=this.options.error,this.state.error=!0})}}});U.install=(t,e={})=>{const r=new(W(t))(e);t.component("lazy-image",U(r))};var q={install(t,e={}){const r=new(W(t))(e),i=new M({lazy:r}),n="2"===t.version.split(".")[0];t.prototype.$Lazyload=r,e.lazyComponent&&t.component("lazy-component",D(r)),e.lazyImage&&t.component("lazy-image",U(r)),n?(t.directive("lazy",{bind:r.add.bind(r),update:r.update.bind(r),componentUpdated:r.lazyLoadHandler.bind(r),unbind:r.remove.bind(r)}),t.directive("lazy-container",{bind:i.bind.bind(i),componentUpdated:i.update.bind(i),unbind:i.unbind.bind(i)})):(t.directive("lazy",{bind:r.lazyLoadHandler.bind(r),update(t,e){v(this.vm.$refs,this.vm.$els),r.add(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:t,oldValue:e},{context:this.vm})},unbind(){r.remove(this.el)}}),t.directive("lazy-container",{update(t,e){i.update(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:t,oldValue:e},{context:this.vm})},unbind(){i.unbind(this.el)}}))}};r(127);q.name="vue-lazyload";e.default=q}})}));
|
|
18
|
+
var i=function(t){return null==t||"function"!=typeof t&&"object"!=typeof t},n=Object.freeze({__proto__:null,default:i,__moduleExports:i}),o=function(t,e){if(null==t)throw new TypeError("expected first argument to be an object.");if(void 0===e||"undefined"==typeof Symbol)return t;if("function"!=typeof Object.getOwnPropertySymbols)return t;for(var r=Object.prototype.propertyIsEnumerable,i=Object(t),n=arguments.length,o=0;++o<n;)for(var s=Object(arguments[o]),a=Object.getOwnPropertySymbols(s),d=0;d<a.length;d++){var l=a[d];r.call(s,l)&&(i[l]=s[l])}return i},s=Object.freeze({__proto__:null,default:o,__moduleExports:o}),a=Object.prototype.toString,d=function(t){var e=typeof t;return"undefined"===e?"undefined":null===t?"null":!0===t||!1===t||t instanceof Boolean?"boolean":"string"===e||t instanceof String?"string":"number"===e||t instanceof Number?"number":"function"===e||t instanceof Function?void 0!==t.constructor.name&&"Generator"===t.constructor.name.slice(0,9)?"generatorfunction":"function":void 0!==Array.isArray&&Array.isArray(t)?"array":t instanceof RegExp?"regexp":t instanceof Date?"date":"[object RegExp]"===(e=a.call(t))?"regexp":"[object Date]"===e?"date":"[object Arguments]"===e?"arguments":"[object Error]"===e?"error":"[object Promise]"===e?"promise":function(t){return t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}(t)?"buffer":"[object Set]"===e?"set":"[object WeakSet]"===e?"weakset":"[object Map]"===e?"map":"[object WeakMap]"===e?"weakmap":"[object Symbol]"===e?"symbol":"[object Map Iterator]"===e?"mapiterator":"[object Set Iterator]"===e?"setiterator":"[object String Iterator]"===e?"stringiterator":"[object Array Iterator]"===e?"arrayiterator":"[object Int8Array]"===e?"int8array":"[object Uint8Array]"===e?"uint8array":"[object Uint8ClampedArray]"===e?"uint8clampedarray":"[object Int16Array]"===e?"int16array":"[object Uint16Array]"===e?"uint16array":"[object Int32Array]"===e?"int32array":"[object Uint32Array]"===e?"uint32array":"[object Float32Array]"===e?"float32array":"[object Float64Array]"===e?"float64array":"object"};var l=Object.freeze({__proto__:null,default:d,__moduleExports:d}),h=n&&i||n,c=s&&o||s,u=l&&d||l;function p(t){t=t||{};var e=arguments.length,r=0;if(1===e)return t;for(;++r<e;){var i=arguments[r];h(t)&&(t=i),b(i)&&f(t,i)}return t}function f(t,e){for(var r in c(t,e),e)if(m(r)&&g(e,r)){var i=e[r];b(i)?("undefined"===u(t[r])&&"function"===u(i)&&(t[r]=i),t[r]=p(t[r]||{},i)):t[r]=i}return t}function b(t){return"object"===u(t)||"function"===u(t)}function g(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function m(t){return"__proto__"!==t&&"constructor"!==t&&"prototype"!==t}var v=p;const y="undefined"!=typeof window&&null!==window,w=function(){if(y&&"IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)return"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}}),!0;return!1}();const _="event",L="observer",E=function(){if(y)return"function"==typeof window.CustomEvent?window.CustomEvent:(t.prototype=window.Event.prototype,t);function t(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var r=document.createEvent("CustomEvent");return r.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),r}}();function z(t,e){if(!t.length)return;const r=t.indexOf(e);return r>-1?t.splice(r,1):void 0}function j(t,e){if("IMG"!==t.tagName||!t.getAttribute("data-srcset"))return;let r=t.getAttribute("data-srcset");const i=[],n=t.parentNode.offsetWidth*e;let o,s,a;r=r.trim().split(","),r.map(t=>{t=t.trim(),o=t.lastIndexOf(" "),-1===o?(s=t,a=999998):(s=t.substr(0,o),a=parseInt(t.substr(o+1,t.length-o-2),10)),i.push([a,s])}),i.sort((function(t,e){if(t[0]<e[0])return 1;if(t[0]>e[0])return-1;if(t[0]===e[0]){if(-1!==e[1].indexOf(".webp",e[1].length-5))return 1;if(-1!==t[1].indexOf(".webp",t[1].length-5))return-1}return 0}));let d,l="";for(let t=0;t<i.length;t++){d=i[t],l=d[1];const e=i[t+1];if(e&&e[0]<n){l=d[1];break}if(!e){l=d[1];break}}return l}function A(t,e){let r;for(let i=0,n=t.length;i<n;i++)if(e(t[i])){r=t[i];break}return r}const x=(t=1)=>y&&window.devicePixelRatio||t;function O(){if(!y)return!1;let t=!0;try{const e=document.createElement("canvas");e.getContext&&e.getContext("2d")&&(t=0===e.toDataURL("image/webp").indexOf("data:image/webp"))}catch(e){t=!1}return t}const $=function(){if(!y)return;let t=!1;try{let e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("test",null,e)}catch(t){}return t}(),T={on(t,e,r,i=!1){$?t.addEventListener(e,r,{capture:i,passive:!0}):t.addEventListener(e,r,i)},off(t,e,r,i=!1){t.removeEventListener(e,r,i)}},I=(t,e,r)=>{let i=new Image;if(!t||!t.src){const t=new Error("image src is required");return r(t)}i.src=t.src,t.cors&&(i.crossOrigin=t.cors),i.onload=function(){e({naturalHeight:i.naturalHeight,naturalWidth:i.naturalWidth,src:i.src})},i.onerror=function(t){r(t)}},S=(t,e)=>"undefined"!=typeof getComputedStyle?getComputedStyle(t,null).getPropertyValue(e):t.style[e],C=t=>S(t,"overflow")+S(t,"overflow-y")+S(t,"overflow-x");function H(){}class Q{constructor({max:t}){this.options={max:t||100},this._caches=[]}has(t){return this._caches.indexOf(t)>-1}add(t){this.has(t)||(this._caches.push(t),this._caches.length>this.options.max&&this.free())}free(){this._caches.shift()}}class R{constructor({el:t,src:e,error:r,loading:i,bindType:n,$parent:o,options:s,cors:a,elRenderer:d,imageCache:l}){this.el=t,this.src=e,this.error=r,this.loading=i,this.bindType=n,this.attempt=0,this.cors=a,this.naturalHeight=0,this.naturalWidth=0,this.options=s,this.rect=null,this.$parent=o,this.elRenderer=d,this._imageCache=l,this.performanceData={init:Date.now(),loadStart:0,loadEnd:0},this.filter(),this.initState(),this.render("loading",!1)}initState(){"dataset"in this.el?this.el.dataset.src=this.src:this.el.setAttribute("data-src",this.src),this.state={loading:!1,error:!1,loaded:!1,rendered:!1}}record(t){this.performanceData[t]=Date.now()}update({src:t,loading:e,error:r}){const i=this.src;this.src=t,this.loading=e,this.error=r,this.filter(),i!==this.src&&(this.attempt=0,this.initState())}getRect(){this.rect=this.el.getBoundingClientRect()}checkInView(){return this.getRect(),this.rect.top<window.innerHeight*this.options.preLoad&&this.rect.bottom>this.options.preLoadTop&&this.rect.left<window.innerWidth*this.options.preLoad&&this.rect.right>0}filter(){(function(t){if(!(t instanceof Object))return[];if(Object.keys)return Object.keys(t);{let e=[];for(let r in t)t.hasOwnProperty(r)&&e.push(r);return e}})(this.options.filter).map(t=>{this.options.filter[t](this,this.options)})}renderLoading(t){this.state.loading=!0,I({src:this.loading,cors:this.cors},e=>{this.render("loading",!1),this.state.loading=!1,t()},()=>{t(),this.state.loading=!1,this.options.silent||console.warn(`VueLazyload log: load failed with loading image(${this.loading})`)})}load(t=H){return this.attempt>this.options.attempt-1&&this.state.error?(this.options.silent||console.log(`VueLazyload log: ${this.src} tried too more than ${this.options.attempt} times`),void t()):this.state.rendered&&this.state.loaded?void 0:this._imageCache.has(this.src)?(this.state.loaded=!0,this.render("loaded",!0),this.state.rendered=!0,t()):void this.renderLoading(()=>{this.attempt++,this.options.adapter.beforeLoad&&this.options.adapter.beforeLoad(this,this.options),this.record("loadStart"),I({src:this.src,cors:this.cors},e=>{this.naturalHeight=e.naturalHeight,this.naturalWidth=e.naturalWidth,this.state.loaded=!0,this.state.error=!1,this.record("loadEnd"),this.render("loaded",!1),this.state.rendered=!0,this._imageCache.add(this.src),t()},t=>{!this.options.silent&&console.error(t),this.state.error=!0,this.state.loaded=!1,this.render("error",!1)})})}render(t,e){this.elRenderer(this,t,e)}performance(){let t="loading",e=0;return this.state.loaded&&(t="loaded",e=(this.performanceData.loadEnd-this.performanceData.loadStart)/1e3),this.state.error&&(t="error"),{src:this.src,state:t,time:e}}$destroy(){this.el=null,this.src=null,this.error=null,this.loading=null,this.bindType=null,this.attempt=0}}const k="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",B=["scroll","wheel","mousewheel","resize","animationend","transitionend","touchmove"],P={rootMargin:"0px",threshold:0};function W(t){return class{constructor({preLoad:t,error:e,throttleWait:r,preLoadTop:i,dispatchEvent:n,loading:o,attempt:s,silent:a=!0,scale:d,listenEvents:l,hasbind:h,filter:c,adapter:u,observer:p,observerOptions:f}){this.version='"1.3.4"',this.mode=_,this.ListenerQueue=[],this.TargetIndex=0,this.TargetQueue=[],this.options={silent:a,dispatchEvent:!!n,throttleWait:r||200,preLoad:t||1.3,preLoadTop:i||0,error:e||k,loading:o||k,attempt:s||3,scale:d||x(d),ListenEvents:l||B,hasbind:!1,supportWebp:O(),filter:c||{},adapter:u||{},observer:!!p,observerOptions:f||P},this._initEvent(),this._imageCache=new Q({max:200}),this.lazyLoadHandler=function(t,e){let r=null,i=null,n=0,o=!1;return function(){if(o=!0,r)return;let s=Date.now()-n,a=this,d=arguments,l=function(){n=Date.now(),r=!1,t.apply(a,d)};s>=e?l():r=setTimeout(l,e),o&&(clearTimeout(i),i=setTimeout(l,2*e))}}(this._lazyLoadHandler.bind(this),this.options.throttleWait),this.setMode(this.options.observer?L:_)}config(t={}){v(this.options,t)}performance(){let t=[];return this.ListenerQueue.map(e=>{t.push(e.performance())}),t}addLazyBox(t){this.ListenerQueue.push(t),y&&(this._addListenerTarget(window),this._observer&&this._observer.observe(t.el),t.$el&&t.$el.parentNode&&this._addListenerTarget(t.$el.parentNode))}add(e,r,i){if(function(t,e){let r=!1;for(let i=0,n=t.length;i<n;i++)if(e(t[i])){r=!0;break}return r}(this.ListenerQueue,t=>t.el===e))return this.update(e,r),t.nextTick(this.lazyLoadHandler);let{src:n,loading:o,error:s,cors:a}=this._valueFormatter(r.value);t.nextTick(()=>{n=j(e,this.options.scale)||n,this._observer&&this._observer.observe(e);const d=Object.keys(r.modifiers)[0];let l;d&&(l=i.context.$refs[d],l=l?l.$el||l:document.getElementById(d)),l||(l=(t=>{if(!y)return;if(!(t instanceof HTMLElement))return window;let e=t;for(;e&&e!==document.body&&e!==document.documentElement&&e.parentNode;){if(/(scroll|auto)/.test(C(e)))return e;e=e.parentNode}return window})(e));const h=new R({bindType:r.arg,$parent:l,el:e,loading:o,error:s,src:n,cors:a,elRenderer:this._elRenderer.bind(this),options:this.options,imageCache:this._imageCache});this.ListenerQueue.push(h),y&&(this._addListenerTarget(window),this._addListenerTarget(l)),this.lazyLoadHandler(),t.nextTick(()=>this.lazyLoadHandler())})}update(e,r,i){let{src:n,loading:o,error:s}=this._valueFormatter(r.value);n=j(e,this.options.scale)||n;const a=A(this.ListenerQueue,t=>t.el===e);a?a.update({src:n,loading:o,error:s}):this.add(e,r,i),this._observer&&(this._observer.unobserve(e),this._observer.observe(e)),this.lazyLoadHandler(),t.nextTick(()=>this.lazyLoadHandler())}remove(t){if(!t)return;this._observer&&this._observer.unobserve(t);const e=A(this.ListenerQueue,e=>e.el===t);e&&(this._removeListenerTarget(e.$parent),this._removeListenerTarget(window),z(this.ListenerQueue,e),e.$destroy())}removeComponent(t){t&&(z(this.ListenerQueue,t),this._observer&&this._observer.unobserve(t.el),t.$parent&&t.$el.parentNode&&this._removeListenerTarget(t.$el.parentNode),this._removeListenerTarget(window))}setMode(t){w||t!==L||(t=_),this.mode=t,t===_?(this._observer&&(this.ListenerQueue.forEach(t=>{this._observer.unobserve(t.el)}),this._observer=null),this.TargetQueue.forEach(t=>{this._initListen(t.el,!0)})):(this.TargetQueue.forEach(t=>{this._initListen(t.el,!1)}),this._initIntersectionObserver())}_addListenerTarget(t){if(!t)return;let e=A(this.TargetQueue,e=>e.el===t);return e?e.childrenCount++:(e={el:t,id:++this.TargetIndex,childrenCount:1,listened:!0},this.mode===_&&this._initListen(e.el,!0),this.TargetQueue.push(e)),this.TargetIndex}_removeListenerTarget(t){this.TargetQueue.forEach((e,r)=>{e.el===t&&(e.childrenCount--,e.childrenCount||(this._initListen(e.el,!1),this.TargetQueue.splice(r,1),e=null))})}_initListen(t,e){this.options.ListenEvents.forEach(r=>T[e?"on":"off"](t,r,this.lazyLoadHandler))}_initEvent(){this.Event={listeners:{loading:[],loaded:[],error:[]}},this.$on=(t,e)=>{this.Event.listeners[t]||(this.Event.listeners[t]=[]),this.Event.listeners[t].push(e)},this.$once=(t,e)=>{const r=this;this.$on(t,(function i(){r.$off(t,i),e.apply(r,arguments)}))},this.$off=(t,e)=>{if(e)z(this.Event.listeners[t],e);else{if(!this.Event.listeners[t])return;this.Event.listeners[t].length=0}},this.$emit=(t,e,r)=>{this.Event.listeners[t]&&this.Event.listeners[t].forEach(t=>t(e,r))}}_lazyLoadHandler(){const t=[];this.ListenerQueue.forEach((e,r)=>{e.el&&e.el.parentNode||t.push(e);e.checkInView()&&e.load()}),t.forEach(t=>{z(this.ListenerQueue,t),t.$destroy()})}_initIntersectionObserver(){w&&(this._observer=new IntersectionObserver(this._observerHandler.bind(this),this.options.observerOptions),this.ListenerQueue.length&&this.ListenerQueue.forEach(t=>{this._observer.observe(t.el)}))}_observerHandler(t,e){t.forEach(t=>{t.isIntersecting&&this.ListenerQueue.forEach(e=>{if(e.el===t.target){if(e.state.loaded)return this._observer.unobserve(e.el);e.load()}})})}_elRenderer(t,e,r){if(!t.el)return;const{el:i,bindType:n}=t;let o;switch(e){case"loading":o=t.loading;break;case"error":o=t.error;break;default:o=t.src}if(n?i.style[n]='url("'+o+'")':i.getAttribute("src")!==o&&i.setAttribute("src",o),i.setAttribute("lazy",e),this.$emit(e,t,r),this.options.adapter[e]&&this.options.adapter[e](t,this.options),this.options.dispatchEvent){const r=new E(e,{detail:t});i.dispatchEvent(r)}}_valueFormatter(t){let e=t,r=this.options.loading,i=this.options.error;var n;return null!==(n=t)&&"object"==typeof n&&(t.src||this.options.silent||console.error("Vue Lazyload warning: miss src with "+t),e=t.src,r=t.loading||this.options.loading,i=t.error||this.options.error),{src:e,loading:r,error:i}}}}W.install=(t,e={})=>{const r=new(W(t))(e);"2"===t.version.split(".")[0]?t.directive("lazy",{bind:r.add.bind(r),update:r.update.bind(r),componentUpdated:r.lazyLoadHandler.bind(r),unbind:r.remove.bind(r)}):t.directive("lazy",{bind:r.lazyLoadHandler.bind(r),update(t,e){v(this.vm.$refs,this.vm.$els),r.add(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:t,oldValue:e},{context:this.vm})},unbind(){r.remove(this.el)}})};const D=t=>({props:{tag:{type:String,default:"div"}},render(t){return t(this.tag,null,this.show?this.$slots.default:null)},data:()=>({el:null,state:{loaded:!1},rect:{},show:!1}),mounted(){this.el=this.$el,t.addLazyBox(this),t.lazyLoadHandler()},beforeDestroy(){t.removeComponent(this)},methods:{getRect(){this.rect=this.$el.getBoundingClientRect()},checkInView(){return this.getRect(),y&&this.rect.top<window.innerHeight*t.options.preLoad&&this.rect.bottom>0&&this.rect.left<window.innerWidth*t.options.preLoad&&this.rect.right>0},load(){this.show=!0,this.state.loaded=!0,this.$emit("show",this)},destroy(){return this.$destroy}}});D.install=function(t,e={}){const r=new(W(t))(e);t.component("lazy-component",D(r))};class M{constructor({lazy:t}){this.lazy=t,t.lazyContainerMananger=this,this._queue=[]}bind(t,e,r){const i=new N({el:t,binding:e,vnode:r,lazy:this.lazy});this._queue.push(i)}update(t,e,r){const i=A(this._queue,e=>e.el===t);i&&i.update({el:t,binding:e,vnode:r})}unbind(t,e,r){const i=A(this._queue,e=>e.el===t);i&&(i.clear(),z(this._queue,i))}}const V={selector:"img"};class N{constructor({el:t,binding:e,vnode:r,lazy:i}){this.el=null,this.vnode=r,this.binding=e,this.options={},this.lazy=i,this._queue=[],this.update({el:t,binding:e})}update({el:t,binding:e}){this.el=t,this.options=v({},V,e.value);this.getImgs().forEach(t=>{this.lazy.add(t,v({},this.binding,{value:{src:"dataset"in t?t.dataset.src:t.getAttribute("data-src"),error:("dataset"in t?t.dataset.error:t.getAttribute("data-error"))||this.options.error,loading:("dataset"in t?t.dataset.loading:t.getAttribute("data-loading"))||this.options.loading}}),this.vnode)})}getImgs(){return function(t){let e=t.length;const r=[];for(let i=0;i<e;i++)r.push(t[i]);return r}(this.el.querySelectorAll(this.options.selector))}clear(){this.getImgs().forEach(t=>this.lazy.remove(t)),this.vnode=null,this.binding=null,this.lazy=null}}N.install=(t,e={})=>{const r=new(W(t))(e),i=new N({lazy:r});"2"===t.version.split(".")[0]?t.directive("lazy-container",{bind:i.bind.bind(i),componentUpdated:i.update.bind(i),unbind:i.unbind.bind(i)}):t.directive("lazy-container",{update(t,e){i.update(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:t,oldValue:e},{context:this.vm})},unbind(){i.unbind(this.el)}})};const U=t=>({props:{src:[String,Object],tag:{type:String,default:"img"}},render(t){return t(this.tag,{attrs:{src:this.renderSrc}},this.$slots.default)},data:()=>({el:null,options:{src:"",error:"",loading:"",attempt:t.options.attempt},state:{loaded:!1,error:!1,attempt:0},rect:{},renderSrc:""}),watch:{src(){this.init(),t.addLazyBox(this),t.lazyLoadHandler()}},created(){this.init(),this.renderSrc=this.options.loading},mounted(){this.el=this.$el,t.addLazyBox(this),t.lazyLoadHandler()},beforeDestroy(){t.removeComponent(this)},methods:{init(){const{src:e,loading:r,error:i}=t._valueFormatter(this.src);this.state.loaded=!1,this.options.src=e,this.options.error=i,this.options.loading=r,this.renderSrc=this.options.loading},getRect(){this.rect=this.$el.getBoundingClientRect()},checkInView(){return this.getRect(),y&&this.rect.top<window.innerHeight*t.options.preLoad&&this.rect.bottom>0&&this.rect.left<window.innerWidth*t.options.preLoad&&this.rect.right>0},load(e=H){if(this.state.attempt>this.options.attempt-1&&this.state.error)return t.options.silent||console.log(`VueLazyload log: ${this.options.src} tried too more than ${this.options.attempt} times`),void e();const r=this.options.src;I({src:r},({src:t})=>{this.renderSrc=t,this.state.loaded=!0},t=>{this.state.attempt++,this.renderSrc=this.options.error,this.state.error=!0})}}});U.install=(t,e={})=>{const r=new(W(t))(e);t.component("lazy-image",U(r))};var q={install(t,e={}){const r=new(W(t))(e),i=new M({lazy:r}),n="2"===t.version.split(".")[0];t.prototype.$Lazyload=r,e.lazyComponent&&t.component("lazy-component",D(r)),e.lazyImage&&t.component("lazy-image",U(r)),n?(t.directive("lazy",{bind:r.add.bind(r),update:r.update.bind(r),componentUpdated:r.lazyLoadHandler.bind(r),unbind:r.remove.bind(r)}),t.directive("lazy-container",{bind:i.bind.bind(i),componentUpdated:i.update.bind(i),unbind:i.unbind.bind(i)})):(t.directive("lazy",{bind:r.lazyLoadHandler.bind(r),update(t,e){v(this.vm.$refs,this.vm.$els),r.add(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:t,oldValue:e},{context:this.vm})},unbind(){r.remove(this.el)}}),t.directive("lazy-container",{update(t,e){i.update(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:t,oldValue:e},{context:this.vm})},unbind(){i.unbind(this.el)}}))}};r(129);q.name="vue-lazyload";e.default=q}})}));
|
|
19
19
|
//# sourceMappingURL=lazyload.js.map
|