biigpongsatorn / vue-element-loading

⏳ Loading inside a container or full screen for Vue.js

Home Page:https://vue-element-loading.netlify.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How do you stop the spinner?

princedacy opened this issue · comments

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?

@princedacy You can stop spinner by set active attribute = false.

example

<template>
   <vue-element-loading :active="isActive"/>
</template>

<script>
export default {
   data () {
      return {
         isActive: false
      }
   },
   async created () {
      this.isActive = true
      await this.getSomeData()
      this.isActive = false
   }
}
</script>

@princedacy Can I close this issue ?

that async created function returns an error that it is not a function

@princedacy await this.getSomeData() is your load data function. This is just example.