%PDF- %PDF-
Direktori : /home/graphicd/public_html/vebto/vendor/laravel/horizon/resources/js/ |
Current File : /home/graphicd/public_html/vebto/vendor/laravel/horizon/resources/js/app.js |
import Vue from 'vue'; import Base from './base'; import axios from 'axios'; import Routes from './routes'; import VueRouter from 'vue-router'; import VueJsonPretty from 'vue-json-pretty'; window.Popper = require('popper.js').default; try { window.$ = window.jQuery = require('jquery'); require('bootstrap'); } catch (e) {} let token = document.head.querySelector('meta[name="csrf-token"]'); axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; if (token) { axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; } Vue.use(VueRouter); Vue.prototype.$http = axios.create(); window.Horizon.basePath = '/' + window.Horizon.path; let routerBasePath = window.Horizon.basePath + '/'; if (window.Horizon.path === '' || window.Horizon.path === '/') { routerBasePath = '/'; window.Horizon.basePath = ''; } const router = new VueRouter({ routes: Routes, mode: 'history', base: routerBasePath, }); Vue.component('vue-json-pretty', VueJsonPretty); Vue.component('alert', require('./components/Alert.vue').default); Vue.mixin(Base); Vue.directive('tooltip', function (el, binding) { $(el).tooltip({ title: binding.value, placement: binding.arg, trigger: 'hover', }); }); new Vue({ el: '#horizon', router, data() { return { alert: { type: null, autoClose: 0, message: '', confirmationProceed: null, confirmationCancel: null, }, autoLoadsNewEntries: localStorage.autoLoadsNewEntries === '1', }; }, });