smart-admin/smart-admin-h5/src/plugins/smart.js
2020-11-29 23:35:57 +08:00

25 lines
423 B
JavaScript

let loader = null;
const SmartPlugin = {};
SmartPlugin.install = function(Vue, options) {
Vue.prototype.$smart = {
loading: (message) => {
if (loader) {
loader.hide();
}
loader = Vue.$loading.show({
// Optional parameters
lockScroll: true,
color: '#1989fa'
});
},
loadingClear: () => {
loader.hide();
}
};
};
export default SmartPlugin;