Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Vuejs package, allow you to manage a loading state inside all component, and to display a progressbar

License

NotificationsYou must be signed in to change notification settings

val-bubbleflat/vue-component-loading

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bybubbleflat.com

This package allows you to manage a loading state inside all component, and to display a progressbar (thanks tovue-progressbar) to show the global loading state of your app.

All components have their own loading state, but the progressbar show the global loading state of all components.

Installation

npm install vue-component-loading
importVueLoadingfrom'vue-component-loading'letconfig={progressBar:{color:'#000',failedColor:'#874b4b',thickness:'5px',transition:{speed:'0.2s',opacity:'0.6s',termination:300},}}Vue.use(VueLoading,config);

Seeprogressbar doc for all options for the progressbar

Usage

First, register your progressbar :

<template><vue-loading-component/><router-view></router-view></template>

You can use these methods inside a component to manage its loading state

this.startLoading();// --> this.loading = true : the component starts to load, the progressbar appearthis.endLoading();// --> this.loading = false : the component end to load, the progressbar progress :p (if it's the last component, it disappear)this.failLoading();// --> this.loading = false : show the fail progressbar

Depending on the loading state, you can accessloading boolean in your component

Exemple

<template><divv-if="!loading">        Component Loaded !</div></template><script>exportdefault{mounted(){this.startLoading();setTimeout(()=>{this.endLoading();},2000)}}</script>

License

The MIT License

About

Vuejs package, allow you to manage a loading state inside all component, and to display a progressbar

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp