Skip to content

Commit aac9a84

Browse files
committed
core: relase 3.0.0
1 parent af16d95 commit aac9a84

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-lazyload",
3-
"version": "3.0.0-rc.2",
3+
"version": "3.0.0",
44
"description": "Vue module for lazy-loading images in your vue.js applications.",
55
"main": "vue-lazyload.js",
66
"module": "vue-lazyload.esm.js",
@@ -29,7 +29,8 @@
2929
"browserslist": [
3030
"> 1%",
3131
"last 2 versions",
32-
"not ie < 11"
32+
"not ie",
33+
"not chrome < 49"
3334
],
3435
"license": "MIT",
3536
"jest": {

vue-lazyload.esm.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*!
2-
* Vue-Lazyload.js v3.0.0-rc.1
3-
* (c) 2022 Awe <hilongjw@gmail.com>
2+
* Vue-Lazyload.js v3.0.0
3+
* (c) 2023 Awe <hilongjw@gmail.com>
44
* Released under the MIT License.
55
*/
66

@@ -306,6 +306,9 @@ const scrollParent = el => {
306306
}
307307
return window;
308308
};
309+
function isObject(obj) {
310+
return obj !== null && typeof obj === 'object';
311+
}
309312
function noop() {}
310313
class ImageCache {
311314
constructor(max) {
@@ -535,7 +538,7 @@ const DEFAULT_OBSERVER_OPTIONS = {
535538
};
536539
class Lazy {
537540
constructor({ preLoad, error, throttleWait, preLoadTop, dispatchEvent, loading, attempt, silent = true, scale, listenEvents, filter, adapter, observer, observerOptions }) {
538-
this.version = '"3.0.0-rc.1"';
541+
this.version = '"3.0.0"';
539542
this.lazyContainerMananger = null;
540543
this.mode = modeType.event;
541544
this.ListenerQueue = [];
@@ -633,6 +636,7 @@ class Lazy {
633636
src = getBestSelectionFromSrcset(el, this.options.scale) || src;
634637
const exist = this.ListenerQueue.find(item => item.el === el);
635638
if (!exist) {
639+
// https://github.com/hilongjw/vue-lazyload/issues/374
636640
if (el.getAttribute('lazy') !== 'loaded' || el.dataset.src !== src) {
637641
this.add(el, binding, vnode);
638642
}
@@ -874,7 +878,7 @@ class Lazy {
874878
}
875879
}
876880
_valueFormatter(value) {
877-
if (typeof value === 'object') {
881+
if (isObject(value)) {
878882
if (!value.src && !this.options.silent) console.error('Vue Lazyload warning: miss src with ' + value);
879883
return {
880884
src: value.src,

0 commit comments

Comments
 (0)