Vue.js component [loading layer] from BixBite.
Download library or can be installed as npm
package:
npm i bxb-loading-layer --save-dev
To start using bxb-loading-layer
, you need to do is plugin installation. Somewhere in your main app.js file:
// Import components to Vue application as plugins.
import Loading from 'bxb-loading-layer';
// Install plugins to Vue application.
Vue.use(Loading);
// Create a fresh Vue application instance and attach it to the page.
const app = new Vue({
el: '#app'
});
// Make some vue plugins methods to global.
window.LoadingLayer = app.$loading;
There are one methods for calling loader (show) and one for dismiss them (hide):
let loader = LoadingLayer.show({active: true});
// Logic of you app, example: fetch data from api by axios.
...
loader.hide();
bxb-loading-layer - программное обеспечение с открытым исходным кодом, распространяющееся по лицензии MIT license.