v-lazy-image
Advanced tools
Comparing version 1.2.0 to 1.2.1
/** | ||
* v-lazy-image v1.2.0 | ||
* v-lazy-image v1.2.1 | ||
* (c) 2018 Alex Jover Morales <alexjovermorales@gmail.com> | ||
@@ -26,3 +26,3 @@ * @license MIT | ||
type: Object, | ||
default: {} | ||
default: function () { return ({}); } | ||
} | ||
@@ -29,0 +29,0 @@ }, |
/** | ||
* v-lazy-image v1.2.0 | ||
* v-lazy-image v1.2.1 | ||
* (c) 2018 Alex Jover Morales <alexjovermorales@gmail.com> | ||
@@ -22,3 +22,3 @@ * @license MIT | ||
type: Object, | ||
default: {} | ||
default: function () { return ({}); } | ||
} | ||
@@ -25,0 +25,0 @@ }, |
/** | ||
* v-lazy-image v1.2.0 | ||
* v-lazy-image v1.2.1 | ||
* (c) 2018 Alex Jover Morales <alexjovermorales@gmail.com> | ||
@@ -28,3 +28,3 @@ * @license MIT | ||
type: Object, | ||
default: {} | ||
default: function () { return ({}); } | ||
} | ||
@@ -31,0 +31,0 @@ }, |
/** | ||
* v-lazy-image v1.2.0 | ||
* v-lazy-image v1.2.1 | ||
* (c) 2018 Alex Jover Morales <alexjovermorales@gmail.com> | ||
@@ -7,2 +7,2 @@ * @license MIT | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.VLazyImage={})}(this,function(e){"use strict";var t={props:{src:{type:String,required:!0},srcPlaceholder:{type:String,default:""},srcset:{type:String},intersectionOptions:{type:Object,default:{}}},data:function(){return{observer:null,intersected:!1,loaded:!1}},computed:{srcImage:function(){return this.intersected?this.src:this.srcPlaceholder},srcsetImage:function(){return!(!this.intersected||!this.srcset)&&this.srcset}},render:function(e){return e("img",{attrs:{src:this.srcImage,srcset:this.srcsetImage},class:{"v-lazy-image":!0,"v-lazy-image-loaded":this.loaded}})},mounted:function(){var e=this;this.$el.addEventListener("load",function(t){e.$el.src===e.src&&(e.loaded=!0,e.$emit("load"))}),this.observer=new IntersectionObserver(function(t){t[0].isIntersecting&&(e.intersected=!0,e.observer.disconnect(),e.$emit("intersect"))},this.intersectionOptions),this.observer.observe(this.$el)},destroyed:function(){this.observer.disconnect()}},s={install:function(e,s){e.component("VLazyImage",t)}};e.default=t,e.VLazyImagePlugin=s,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.VLazyImage={})}(this,function(e){"use strict";var t={props:{src:{type:String,required:!0},srcPlaceholder:{type:String,default:""},srcset:{type:String},intersectionOptions:{type:Object,default:function(){return{}}}},data:function(){return{observer:null,intersected:!1,loaded:!1}},computed:{srcImage:function(){return this.intersected?this.src:this.srcPlaceholder},srcsetImage:function(){return!(!this.intersected||!this.srcset)&&this.srcset}},render:function(e){return e("img",{attrs:{src:this.srcImage,srcset:this.srcsetImage},class:{"v-lazy-image":!0,"v-lazy-image-loaded":this.loaded}})},mounted:function(){var e=this;this.$el.addEventListener("load",function(t){e.$el.src===e.src&&(e.loaded=!0,e.$emit("load"))}),this.observer=new IntersectionObserver(function(t){t[0].isIntersecting&&(e.intersected=!0,e.observer.disconnect(),e.$emit("intersect"))},this.intersectionOptions),this.observer.observe(this.$el)},destroyed:function(){this.observer.disconnect()}},s={install:function(e,s){e.component("VLazyImage",t)}};e.default=t,e.VLazyImagePlugin=s,Object.defineProperty(e,"__esModule",{value:!0})}); |
{ | ||
"name": "v-lazy-image", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "A Vue.js component to lazy load images using the Intersection Observer", | ||
@@ -5,0 +5,0 @@ "main": "dist/v-lazy-image.cjs.js", |
@@ -16,3 +16,3 @@ const VLazyImageComponent = { | ||
type: Object, | ||
default: {} | ||
default: () => ({}) | ||
} | ||
@@ -19,0 +19,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15833