Changeset View
Changeset View
Standalone View
Standalone View
src/resources/js/bootstrap.js
Show All 21 Lines | |||||
/** | /** | ||||
* Load Vue, VueRouter and global components | * Load Vue, VueRouter and global components | ||||
*/ | */ | ||||
import Vue from 'vue' | import Vue from 'vue' | ||||
import VueRouter from 'vue-router' | import VueRouter from 'vue-router' | ||||
import Btn from '../vue/Widgets/Btn' | import Btn from '../vue/Widgets/Btn' | ||||
import BtnRouter from '../vue/Widgets/BtnRouter' | import BtnRouter from '../vue/Widgets/BtnRouter' | ||||
import Tabs from '../vue/Widgets/Tabs' | |||||
import Toast from '../vue/Widgets/Toast' | import Toast from '../vue/Widgets/Toast' | ||||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' | import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' | ||||
import { Tooltip } from 'bootstrap' | import { Tooltip } from 'bootstrap' | ||||
window.Vue = Vue | window.Vue = Vue | ||||
Vue.component('SvgIcon', FontAwesomeIcon) | |||||
Vue.component('Btn', Btn) | Vue.component('Btn', Btn) | ||||
Vue.component('BtnRouter', BtnRouter) | Vue.component('BtnRouter', BtnRouter) | ||||
Vue.component('SvgIcon', FontAwesomeIcon) | |||||
Vue.component('Tabs', Tabs) | |||||
const vTooltip = (el, binding) => { | const vTooltip = (el, binding) => { | ||||
let t = [] | let t = [] | ||||
if (binding.modifiers.focus) t.push('focus') | if (binding.modifiers.focus) t.push('focus') | ||||
if (binding.modifiers.hover) t.push('hover') | if (binding.modifiers.hover) t.push('hover') | ||||
if (binding.modifiers.click) t.push('click') | if (binding.modifiers.click) t.push('click') | ||||
if (!t.length) t.push('click') | if (!t.length) t.push('click') | ||||
Show All 10 Lines | Vue.directive('tooltip', { | ||||
bind: vTooltip, | bind: vTooltip, | ||||
update: vTooltip, | update: vTooltip, | ||||
unbind (el) { | unbind (el) { | ||||
el.tooltip.dispose() | el.tooltip.dispose() | ||||
} | } | ||||
}) | }) | ||||
Vue.use(Toast) | Vue.use(Toast) | ||||
Vue.use(VueRouter) | Vue.use(VueRouter) | ||||
let vueRouterBase = '/' | let vueRouterBase = '/' | ||||
try { | try { | ||||
let url = new URL(window.config['app.url']) | let url = new URL(window.config['app.url']) | ||||
vueRouterBase = url.pathname | vueRouterBase = url.pathname | ||||
} catch(e) { | } catch(e) { | ||||
// ignore | // ignore | ||||
Show All 32 Lines |