onspot-frontend/src/main.js

68 lines
1.4 KiB
JavaScript
Raw Permalink Normal View History

2020-11-25 16:19:00 +01:00
import Vue from 'vue'
2020-11-26 01:30:15 +01:00
import App from '@/App.vue'
import router from '@/router'
import store from '@/store'
import api from "@/api";
2020-11-27 01:34:54 +01:00
import * as Sentry from "@sentry/browser";
import { Vue as VueIntegration } from "@sentry/integrations";
// Setup sentry
if (process.env.VUE_APP_SENTRY_DSN) {
Sentry.init({
dsn: process.env.VUE_APP_SENTRY_DSN,
integrations: [new VueIntegration({Vue, attachProps: true})],
});
}
2020-11-26 01:30:15 +01:00
import { BootstrapVue, IconsPlugin } from 'bootstrap-vue'
import 'bootstrap/dist/css/bootstrap.css'
import 'bootstrap-vue/dist/bootstrap-vue.css'
2020-11-25 16:19:00 +01:00
Vue.config.productionTip = false
2020-11-26 01:30:15 +01:00
Vue.prototype.$api = api
Vue.use(BootstrapVue)
Vue.use(IconsPlugin)
2020-11-25 16:19:00 +01:00
2020-11-26 03:18:28 +01:00
Vue.prototype.$showToast = function (text, type = 'error', local=true) {
let options = {}
switch (type) {
case "error":
options = {
title: "Error!",
variant: "danger"
}
break;
case "user_error":
options = {
title: "Warning!",
variant: "warning"
}
break;
case "success":
options = {
title: "Success!",
variant: "success"
}
break;
}
const bvToast = local ? this.$bvToast : this.$root.$bvToast
bvToast.toast(text, {
...options,
toaster: 'b-toaster-top-center',
solid: true,
appendToast: false
})
}
2020-11-25 16:19:00 +01:00
new Vue({
router,
store,
render: h => h(App)
}).$mount('#app')