From cc085c36f263b0325465831423c4f0266e0bfd68 Mon Sep 17 00:00:00 2001 From: SchnapsterDog Date: Fri, 14 Jul 2023 12:41:00 +0200 Subject: [PATCH] feat: added new prop 'overflowActive' for handling the global overflow --- README.md | 1 + package.json | 2 +- src/components/VuePreloader.vue | 4 ++-- src/props/index.ts | 4 ++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6c6f05a..630eb1a 100644 --- a/README.md +++ b/README.md @@ -199,6 +199,7 @@ The transition-type prop in the Vue preloader component specifies the type of fa |**background-color**|`String`|`#091a28`|The prop background-color allows you to customize the background color of the preloader component. You can pass in a string value that represents a valid HEX color, such as #000000. |**color**|`String`|`#ffffff`|This prop allows you to customize the color of loading bar. |**loading-speed**|`Number`|`15`|The loading-speed prop is used to adjust the speed of the loading bar. You can pass in a number value that represents the animation speed in milliseconds. A lower value will result in a faster animation, while a higher value will slow it down. This prop can take an integer value. +|**overflow-active**|`Boolean`|`true`| Set overflow of the page |**transition-speed**|`Number`|`1400`|The transition-speed prop is used to adjust the speed of the transition between the preloader and the main content of your application. You can pass in a number value that represents the transition speed in milliseconds. A lower value will result in a faster transition, while a higher value will slow it down. |**transition-type**|`String`|`fade-left`|The transition-type prop accepts four possible values: fade-left, fade-right, fade-up, and fade-down. Each value specifies the direction in which the preloader will fade out of view. When the transition-type prop is not specified, the preloader will fade out of view towards the left. |**transition-is-over**|`Event`|`/`|The event transition-is-over is fired when the transition is over and the component is no longer available in the DOM. It can be useful to create logic when the vue-loader should be re-rendered. diff --git a/package.json b/package.json index 19a877d..0c227b0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vue-preloader", "description": "Vue-Preloader is a versatile and easy-to-use Vue.js component that allows you to add loading animations to your Vue.js or Nuxt.js projects. It is compatible with both Vue 2 and Vue 3.", - "version": "1.1.0", + "version": "1.1.1", "private": false, "homepage": "https://vue-preloader.com/", "author": { diff --git a/src/components/VuePreloader.vue b/src/components/VuePreloader.vue index b0c5e0d..9b15543 100644 --- a/src/components/VuePreloader.vue +++ b/src/components/VuePreloader.vue @@ -39,7 +39,7 @@ watchEffect(() => { }); onBeforeMount(() => { - setOverflowHidden() + if (props.overflowActve) setOverflowHidden() }); onMounted(() => { @@ -61,7 +61,7 @@ function setOverflowHidden() { function transitionIsOver() { setTimeout(() => { emit('transition-is-over') - setOverflowAuto() + if (props.overflowActve) setOverflowAuto() }, props.transitionSpeed) } diff --git a/src/props/index.ts b/src/props/index.ts index 5154130..19360de 100644 --- a/src/props/index.ts +++ b/src/props/index.ts @@ -13,6 +13,10 @@ const definedProps = { type: Number as PropType, default: 15 }, + overflowActve: { + type: Boolean, + default: true + }, transitionSpeed: { type: Number as PropType, default: 1400