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.

Load Me!

API #

NameTypeParametersDescriptiondefault
$vs.loading()FunctionObjectfunction to open loading.
$vs.loading.close()Functionfunction to close loading.
containerHTMLElement, StringContainer that will be loading, pass a HTMLElement or query selector
colorStringRGB, HEX, primary, danger, success, dark, warningColor of loading.
typeStringdefault, point, reduis, border, corners, sound, materialChange the type of animation.default
backgroundStringRGB, HEX, primary, danger, success, dark, warningloading background.rgba(255, 255, 255,.8)
textStringAdd a text on the loading .
textAfterBooleanChange the position of the text when loading .false
scaleNumber0 - 1change the scale of the animation.1
clickEffectBooleanAdd an animation to the user to click while loading is active.false