vue-loading-overlay
Advanced tools
Comparing version 2.0.1 to 2.0.2
# Changelog | ||
### [2.0.2](https://github.com/ankurk91/vue-loading-overlay/compare/2.0.1...2.0.2) | ||
* Fix: Don't call `onCancel` prop functions when loader is not active | ||
### [2.0.1](https://github.com/ankurk91/vue-loading-overlay/compare/2.0.0...2.0.1) | ||
@@ -4,0 +7,0 @@ * Fix: Was not working in non module environments |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("Vue")):"function"==typeof define&&define.amd?define("VueLoading",["Vue"],t):"object"==typeof exports?exports.VueLoading=t(require("Vue")):e.VueLoading=t(e.Vue)}("undefined"!=typeof self?self:this,function(e){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(2),i=n.n(o),r=function(e){void 0!==e.remove?e.remove():e.parentNode.removeChild(e)},a=function(){return"undefined"!=typeof window},c={name:"vue-loading",props:{active:Boolean,programmatic:Boolean,animation:{type:String,default:"fade"},canCancel:{type:Boolean,default:!1},onCancel:{type:Function,default:function(){}}},data:function(){return{isActive:this.active||!1}},created:function(){a&&document.addEventListener("keyup",this.escape)},beforeMount:function(){this.programmatic&&document.body.appendChild(this.$el)},mounted:function(){this.programmatic&&(this.isActive=!0)},methods:{cancel:function(){this.canCancel&&this.hide()},hide:function(){var e=this;this.onCancel.apply(null,arguments),this.$emit("close"),this.$emit("update:active",!1),this.programmatic&&(this.isActive=!1,setTimeout(function(){e.$destroy(),r(e.$el)},150))},escape:function(e){27===e.keyCode&&this.cancel()}},watch:{active:function(e){this.isActive=e}},beforeDestroy:function(){a&&document.removeEventListener("keyup",this.escape)}},s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:e.animation}},[e.isActive?n("div",{staticClass:"loading-overlay is-active"},[n("div",{staticClass:"loading-background",on:{click:function(t){t.preventDefault(),e.cancel(t)}}}),e._v(" "),n("div",{staticClass:"loading-icon"})]):e._e()])},u=[],d=function(e,t,n,o,i,r,a,c){e=e||{};var s=typeof e.default;"object"!==s&&"function"!==s||(e=e.default);var u="function"==typeof e?e.options:e;t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),o&&(u.functional=!0),r&&(u._scopeId=r);var d;if(a?(d=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=d):i&&(d=c?function(){i.call(this,this.$root.$options.shadowRoot)}:i),d)if(u.functional){u._injectStyles=d;var f=u.render;u.render=function(e,t){return d.call(t),f(e,t)}}else{var l=u.beforeCreate;u.beforeCreate=l?[].concat(l,d):[d]}return{exports:e,options:u}}(c,s,u,!1,null,null,null),f=d.exports,l={show:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={programmatic:!0},n=Object.assign(t,e);return new(i.a.extend(f))({el:document.createElement("div"),propsData:n})}},p=l,v=(n(3),function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.$loading=p,Object.defineProperties(e.prototype,{$loading:{get:function(){return p}}})});f.install=v;t.default=f},function(t,n){t.exports=e},function(e,t){}]).default}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("Vue")):"function"==typeof define&&define.amd?define("VueLoading",["Vue"],t):"object"==typeof exports?exports.VueLoading=t(require("Vue")):e.VueLoading=t(e.Vue)}("undefined"!=typeof self?self:this,function(e){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),i=n.n(o),r=function(e){void 0!==e.remove?e.remove():e.parentNode.removeChild(e)},a=function(){return"undefined"!=typeof window},c={name:"vue-loading",props:{active:Boolean,programmatic:Boolean,animation:{type:String,default:"fade"},canCancel:{type:Boolean,default:!1},onCancel:{type:Function,default:function(){}}},data:function(){return{isActive:this.active||!1}},created:function(){a&&document.addEventListener("keyup",this.escape)},beforeMount:function(){a&&this.programmatic&&document.body.appendChild(this.$el)},mounted:function(){this.programmatic&&(this.isActive=!0)},methods:{cancel:function(){this.canCancel&&this.isActive&&this.hide()},hide:function(){var e=this;this.onCancel.apply(null,arguments),this.$emit("close"),this.$emit("update:active",!1),this.programmatic&&(this.isActive=!1,setTimeout(function(){e.$destroy(),r(e.$el)},150))},escape:function(e){27===e.keyCode&&this.cancel()}},watch:{active:function(e){this.isActive=e}},beforeDestroy:function(){a&&document.removeEventListener("keyup",this.escape)}},s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:e.animation}},[e.isActive?n("div",{staticClass:"loading-overlay is-active"},[n("div",{staticClass:"loading-background",on:{click:function(t){t.preventDefault(),e.cancel(t)}}}),e._v(" "),n("div",{staticClass:"loading-icon"})]):e._e()])},u=[],d=function(e,t,n,o,i,r,a,c){e=e||{};var s=typeof e.default;"object"!==s&&"function"!==s||(e=e.default);var u="function"==typeof e?e.options:e;t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),o&&(u.functional=!0),r&&(u._scopeId=r);var d;if(a?(d=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=d):i&&(d=c?function(){i.call(this,this.$root.$options.shadowRoot)}:i),d)if(u.functional){u._injectStyles=d;var f=u.render;u.render=function(e,t){return d.call(t),f(e,t)}}else{var l=u.beforeCreate;u.beforeCreate=l?[].concat(l,d):[d]}return{exports:e,options:u}}(c,s,u,!1,null,null,null),f=d.exports,l={show:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={programmatic:!0},n=Object.assign(t,e);return new(i.a.extend(f))({el:document.createElement("div"),propsData:n})}},p=l,v=(n(2),function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.$loading=p,Object.defineProperties(e.prototype,{$loading:{get:function(){return p}}})});f.install=v;t.default=f},function(t,n){t.exports=e},function(e,t){}]).default}); |
{ | ||
"name": "vue-loading-overlay", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Vue.js v2.x component for full screen loading indicator", | ||
"main": "dist/vue-loading.min.js", | ||
"unpkg": "dist/vue-loading.min.js", | ||
"style": "dist/vue-loading.min.css", | ||
"files": [ | ||
@@ -8,0 +9,0 @@ "src", |
@@ -28,3 +28,4 @@ # Vue Loading Overlay Component | ||
<div> | ||
<loading :active.sync="isSaving" :can-cancel="true"></loading> | ||
<loading :active.sync="isLoading" :can-cancel="true" :onCancel="whenCancelled"></loading> | ||
<button @click.prevent="fetchData">fetch Data</button> | ||
</div> | ||
@@ -37,3 +38,3 @@ </template> | ||
// Import stylesheet | ||
import 'vue-loading-overlay/dist/vue-loading.min'; | ||
import 'vue-loading-overlay/dist/vue-loading.min.css'; | ||
@@ -43,3 +44,3 @@ export default { | ||
return { | ||
isSaving: false, | ||
isLoading: false, | ||
} | ||
@@ -51,5 +52,11 @@ }, | ||
methods: { | ||
submit() { | ||
this.isSaving = true; | ||
// do AJAX here | ||
fetchData() { | ||
this.isLoading = true; | ||
// AJAX example with axios | ||
axios.post('/api').then((response)=>{ | ||
this.isLoading = false | ||
}) | ||
}, | ||
whenCancelled() { | ||
console.log("User cancelled the loader.") | ||
} | ||
@@ -74,3 +81,3 @@ } | ||
// Import stylesheet | ||
import 'vue-loading-overlay/dist/vue-loading.min'; | ||
import 'vue-loading-overlay/dist/vue-loading.min.css'; | ||
// Init plugin | ||
@@ -106,3 +113,3 @@ Vue.use(Loading); | ||
<script src="https://unpkg.com/vue-loading-overlay@2"></script> | ||
<link rel="stylesheet" href="https://unpkg.com/vue-loading-overlay@latest/dist/vue-loading.min.css"> | ||
<link href="https://unpkg.com/vue-loading-overlay@latest/dist/vue-loading.min.css" rel="stylesheet"> | ||
<!-- Init the plugin --> | ||
@@ -109,0 +116,0 @@ <script> |
Sorry, the diff of this file is not supported yet
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
15822
127