To add a loading in any part of your application we have the global function $vs.loading()
, and then when you want to remove it we have $vs.loading.close()
For the examples, the request or the delay is simulated with setTimeout
Loading Default
<template>
<div class="demo-alignment">
<vs-button @click="openLoading" type="filled" color="primary">Loading Default</vs-button>
</div>
</template>
<script>
export default {
methods:{
openLoading(){
this.$vs.loading()
setTimeout( ()=> {
this.$vs.loading.close()
}, 2000);
},
}
}
</script>