Implemented login/logout
This commit is contained in:
35
src/main.js
35
src/main.js
@ -15,6 +15,41 @@ Vue.prototype.$api = api
|
||||
Vue.use(BootstrapVue)
|
||||
Vue.use(IconsPlugin)
|
||||
|
||||
|
||||
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
|
||||
})
|
||||
}
|
||||
|
||||
new Vue({
|
||||
router,
|
||||
store,
|
||||
|
Reference in New Issue
Block a user