| 1 |
import Vue from 'vue' |
| 2 |
import Axios from 'axios' |
| 3 |
import VueAxios from 'vue-axios' |
| 4 |
import Toasted from 'vue-toasted' |
| 5 |
import moment from 'moment-timezone' |
| 6 |
import mixin from '@dashboard-mixins/index' |
| 7 |
import store from '@dashboard-store/index' |
| 8 |
import Appointments from '@dashboard-components/appointments' |
| 9 |
import Services from '@dashboard-components/services' |
| 10 |
import Staff from '@dashboard-components/staff' |
| 11 |
import Customers from '@dashboard-components/customers' |
| 12 |
import Settings from '@dashboard-components/settings' |
| 13 |
import { VuejsDatatableFactory } from 'vuejs-datatable' |
| 14 |
import VueInputAutowidth from 'vue-input-autowidth' |
| 15 |
import Calendar from '@dashboard-components/calendar' |
| 16 |
/** |
| 17 |
* Init Moment |
| 18 |
*/ |
| 19 |
moment.tz.setDefault('GMT'); |
| 20 |
Vue.prototype.moment = moment; |
| 21 |
Vue.filter('moment', function (date, format) { |
| 22 |
return moment(date).format(format); |
| 23 |
}); |
| 24 |
|
| 25 |
VuejsDatatableFactory.useDefaultType( false ) |
| 26 |
.registerTableType( 'datatable', tableType => tableType.mergeSettings( { |
| 27 |
table: { |
| 28 |
class: 'bookit-table', |
| 29 |
sorting: { |
| 30 |
sortAsc: '↑', |
| 31 |
sortDesc: '↓', |
| 32 |
sortNone: '<span class="arrow-up-down"></span>', |
| 33 |
}, |
| 34 |
} |
| 35 |
} ) ); |
| 36 |
|
| 37 |
window.addEventListener('load', () => { |
| 38 |
Vue.use( VuejsDatatableFactory ); |
| 39 |
Vue.use( VueInputAutowidth ); |
| 40 |
Vue.use( VueAxios, Axios ); |
| 41 |
Vue.use( Toasted, { |
| 42 |
duration: 2000 |
| 43 |
} ); |
| 44 |
Vue.mixin( mixin ); |
| 45 |
|
| 46 |
new Vue({ |
| 47 |
store, // render vuex |
| 48 |
el: '#bookit-dashboard-app', // selector |
| 49 |
components: { |
| 50 |
'bookit-appointments': Appointments, |
| 51 |
'bookit-services': Services, |
| 52 |
'bookit-staff': Staff, |
| 53 |
'bookit-customers': Customers, |
| 54 |
'bookit-settings': Settings, |
| 55 |
'bookit': Calendar, |
| 56 |
}, |
| 57 |
}); |
| 58 |
}); |