Loading
Very simple to implement and remove.
Default
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()
.
TIP
For the examples, the request or the delay is simulated with setTimeout
.
TIP
For Composition API, you can use inject to retrieve $vs :
import { inject } from 'vue'
const $vs = inject('$vs')
$vs.loading()
setTimeout( ()=> {
$vs.loading.close()
}, 2000);
since vuesax3@^4.0.24
Type
You can change the type of animation with the type
property and the animations so far are:
- point
- radius
- border
- corners
- sound
- material
Color
You can change the color of the loading with the property color
.
WARNING
Only RGB and HEX colors are supported.
Background
If you need to change the background of the loading, you can use the property background
.
WARNING
Only RGB and HEX colors are supported.
Contained
To add a loading within a container, call the $ vs.loading ()
global function passing the container
and the scale
parameters. When you want to remove it we have $ vs.loading.close ()
, passing the same container
parameter.
TIP
For the examples, the request or the delay is simulated with setTimeout
.