biigpongsatorn / vue-element-loading Goto Github PK
View Code? Open in Web Editor NEW⏳ Loading inside a container or full screen for Vue.js
Home Page: https://vue-element-loading.netlify.com/
License: MIT License
⏳ Loading inside a container or full screen for Vue.js
Home Page: https://vue-element-loading.netlify.com/
License: MIT License
Hi. In full-screen mode spinner have z-index=999. But bootstrap 4 modal have z-index=1050; So full-screen spinner is under bootstrap modal.
Hey,
your fully featured live demo isn't available anymore. Got a 404 from https://vue-element-loading.netlify.app/dist/build.js
when opening https://vue-element-loading.netlify.app/
Cheers
I'm facing this error
[Vue warn]: Property or method "isActive" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.
my code
<template>
<div>
<vue-element-loading :active="isActive" :is-full-screen="true"/>
</div>
</template>
<script>
import VueElementLoading from 'vue-element-loading';
export default {
data() {
return {
app_name: process.env.MIX_APP_NAME,
}
},
components: {
VueElementLoading
}
}
</script>
+
How can I select the type of loader i want?
any idea?
On the doc, i have to use something like this
<vue-element-loading :active="show" spinner="bar-fade-scale" color="#FF6700"/>
but how can i start/stop loading element like this for full screen
this.$loading.start()
this.$loading.stop()
$loading could be something else to prevent conflict with other library
Thanks
Is there a way when using as a component to set default config so you dont have to put it in every place the loader is used?
import Vue from 'vue'
import VueElementLoading from 'vue-element-loading'
const options = {
spinner:"spinner",
color:"#E91E63"
}
Vue.component('VueElementLoading', VueElementLoading)
use typescript in this library?
I can create PR for this :)
It was fixed recently but it seems not in minified version ! I got this error when using it with v1.1.
[Vue warn]: Invalid default value for prop "textStyle": Props with type Object/Array must use a factory function to return the default value.
found in
---> <VueElementLoading> at index.vue
<AppButtonPrincipal> at src\components\ui\AppButtonPrincipal.vue
<Index> at src\components\pages\OverviewPage\index.vue
<TheDashboard> at src\components\layout\TheDashboard.vue
<App> at src\App.vue
<Root>
Hello,
excellent app 👍 , I have a question, is it possible to change the color of the background, by means of a property in vue-element-loading, as well as a color is passed in the color property?
Example:
<vue-element-loading :active="isActive" spinner="bar-fade-scale" color="#FF6700" background="#1a1b1c"/>
in the file: src/index.vue
.velmld-overlay {
background-color: rgba(255, 255, 255, .9);
}
Thanks!
I am using weback to bundle my files and I get a console error SCRIPT1002: Syntax error
.
I don't understand where it comes from ... Does someone have an idea ?
Sometime the same loading action can take from 0.01 second to 2 seconds. If the loading takes less than ~0.5 second user will only see a "blink". Is it possible to add delay which prevents from showing the loader if the "active" value will be set to true for less than X milliseconds?
I was testing this with Vue 3 and adding
import VueElementLoading from 'vue-element-loading'
and
<vue-element-loading :active="isActive" spinner="bar-fade-scale" color="#FF6700"/>
in my component is giving all sorts of errors.
Property "isActive" was accessed during render but is not defined on instance.
TypeError: selfHook.call is not a function
Uncaught (in promise) TypeError: Cannot read property 'parentNode' of null
and so on..
Any fixes as Vue 3 is coming out soon..
Thank you for this great plugin. However I get an error in IE 11 even in the latest version (1.1.2). The problem is in the vue-element-loading.min.js
file since there is an arrow function used which is not supported by IE 11.
Why did you pull down all the older versions?
Anything after 1.0.6 breaks in Nuxt since you added in the div for text to display when loading it will not work in Nuxt.
Now I need 1.0.6 and all you have available is 1.1.4 which is useless to me.
Please put back the other versions.
The spinner keeps loading even after the component has loaded all the data.
How do you stop it or give it a timer like a certain number of seconds?
Size is always 40px
whatever value you pass its always the same
<button @click="apply(props.row)" class="btn green-haze">
<span v-if="!applying"><i class="fas fa-check"></i> Apply</span>
<vue-element-loading :active="applying" size="25" spinner="ring" color="#ffffff"/>
</button>
这个不兼容Android低版本
it is not support android5.0
Hi everyone I faced problem in vue ssr project
When I import vue-element-loading I get this error in ssr:
ReferenceError: document is not defined
at /Users/denis/Documents/projects/project-ssr/node_modules/vue-element-loading/node_modules/vue-runtime-helpers/inject-style/browser.js:6:14
at /Users/denis/Documents/projects/project-ssr/node_modules/vue-element-loading/lib/vue-element-loading.min.js:6:84
at Object.<anonymous> (/Users/denis/Documents/projects/project-ssr/node_modules/vue-element-loading/lib/vue-element-loading.min.js:6:160)
at Module._compile (internal/modules/cjs/loader.js:759:30)
at Module._compile (/Users/denis/Documents/projects/project-ssr/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:770:10)
at Object.newLoader [as .js] (/Users/denis/Documents/projects/project-ssr/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:628:32)
at Function.Module._load (internal/modules/cjs/loader.js:555:12)
at Module.require (internal/modules/cjs/loader.js:666:19)
at require (internal/modules/cjs/helpers.js:16:16)
at r (/Users/denis/Documents/projects/project-ssr/node_modules/vue-server-renderer/build.dev.js:9315:16)
at eval (webpack-internal:///vue-element-loading:1:18)
at Object.vue-element-loading (main.js:1566:1)
at __webpack_require__ (main.js:21:30)
at eval (webpack-internal:///../node_modules/babel-loader/lib/index.js!../node_modules/vue-loader/lib/index.js?!./vue/blog/index.vue?vue&type=script&lang=js&:14:49)
And in client:
500 | Internal Server Error
Fixed it all, please merge and publish to npm
Made the module even better I hope it will not be difficult for you to allocate a few minutes for this
Thanks
Uncaught TypeError: Object(...) is not a function
at Module.fb15 (VueElementLoading.common.js:661)
at __webpack_require__ (VueElementLoading.common.js:21)
at eval (VueElementLoading.common.js:85)
at eval (VueElementLoading.common.js:88)
at Object.../node_modules/vue-element-loading/dist/VueElementLoading.common.js (vendors~index.chunk.js:3731)
at __webpack_require__ (index.bundle.js:80)
at eval (day.vue?../node_modules/babel-loader/lib!../node_modules/vue-loader/lib??vue-loader-options:18)
at Object.../node_modules/babel-loader/lib/index.js!../node_modules/vue-loader/lib/index.js?!./src/vue/components/dashboard/user/widgets/day.vue?vue&type=script&lang=js& (index.bundle.js:514)
at __webpack_require__ (index.bundle.js:80)
at eval (VM1323 day.vue:2)
at Module../src/vue/components/dashboard/user/widgets/day.vue?vue&type=script&lang=js& (index.bundle.js:4275)
at __webpack_require__ (index.bundle.js:80)
at eval (VM1323 day.vue:3)
at Module../src/vue/components/dashboard/user/widgets/day.vue (index.bundle.js:4263)
at __webpack_require__ (index.bundle.js:80)
at Object.eval (dashboard.vue?../node_modules/babel-loader/lib!../node_modules/vue-loader/lib??vue-loader-options:24)
When users update the module in vue 2 projects, they will receive this error since the current version of the module is in the master branch for vue 3. I already said this, but I will repeat the current version of the module in npm, you need to publish with the tag next (npm publish --tag next)
Now you need to remove the 2.0.1 module version from npm so that the 1.1.6 module remains working for vue 2.
In the readme, add information to install the module in the vue 3 project, you need to run the command:
npm i vue-element-loading@next
Hi, I am using axios interceptors to catch unsuccessful requests. and wonder if there is any function or events that I could call to hide the loading from axios like for example "hide_all_loadings()"?
Currently I am firing a global event from axios interceptor indicating request finishing and listening for it inside each individual component to hide the loading.
It's working very well in global loading. but it would be convenient to add such a feature. It will make code simpler and centralized.
export default {
data() {
return {
loading: false
}
},
created(){
EventBus.$on('RequestFinished', r =>{ this.loading = false; });
},
update() {
this.loading = true;
axios.post('/api/citizen/info',{form:this.form}).then(({data}) => {
this.loading = false;
});
}
}
window.axios.interceptors.response.use(axiosSuccessInterceptor, axiosErrorInterceptor);
function axiosSuccessInterceptor(response) {
EventBus.$emit('RequestFinished', response);
}
function axiosErrorInterceptor(response) {
EventBus.$emit('RequestFinished', response);
}
Getting sintax error with arrow functions in version 1.1.6, this error was solved and does not occur with version 1.1.5.
Invalid default value for prop "textStyle": Props with type Object/Array must use a factory function to return the default value.
Using it this way:
async created () {
this.isActive = true
await this.fetchData()
this.isActive = false
}
fetchData()
is axios.get request, so i want to display loader till axios request is complete. How can i accomplish?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.