mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-15 23:23:52 +08:00
smart-admin-h5
This commit is contained in:
17
smart-admin-h5/src/plugins/smart-sentry.js
Normal file
17
smart-admin-h5/src/plugins/smart-sentry.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import * as Sentry from '@sentry/browser';
|
||||
|
||||
const SmartSentry = {};
|
||||
|
||||
SmartSentry.install = function(Vue, options) {
|
||||
Vue.prototype.$smartSentry = {
|
||||
captureException: (error) => {
|
||||
console.error(error);
|
||||
if (error.config && error.data && error && error.headers && error.request && error.status) {
|
||||
return;
|
||||
}
|
||||
Sentry.captureException(error);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export default SmartSentry;
|
||||
24
smart-admin-h5/src/plugins/smart.js
Normal file
24
smart-admin-h5/src/plugins/smart.js
Normal file
@@ -0,0 +1,24 @@
|
||||
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;
|
||||
8
smart-admin-h5/src/plugins/vant.js
Normal file
8
smart-admin-h5/src/plugins/vant.js
Normal file
@@ -0,0 +1,8 @@
|
||||
// 按需全局引入 vant组件
|
||||
import Vue from 'vue';
|
||||
import { Button, List, Cell, Tabbar, TabbarItem } from 'vant';
|
||||
|
||||
Vue.use(Button);
|
||||
Vue.use(Cell);
|
||||
Vue.use(List);
|
||||
Vue.use(Tabbar).use(TabbarItem);
|
||||
Reference in New Issue
Block a user