-
Notifications
You must be signed in to change notification settings - Fork 260
/
Copy pathmain.js
62 lines (54 loc) · 1.35 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import Vue from 'vue';
import App from './App.vue';
import AppFooter from './components/AppFooter';
import SignalRTrips from './components/SignalRTrips';
import router from './router';
import store from './store/index';
import BootstrapVue from 'bootstrap-vue';
import BlockUI from 'vue-blockui';
import VueIziToast from 'vue-izitoast-2';
import 'izitoast/dist/css/iziToast.min.css';
Vue.use(BootstrapVue);
Vue.use(BlockUI);
Vue.use(VueIziToast);
Vue.config.productionTip = false;
Vue.directive('scroll', {
inserted: function(el, binding) {
let f = function(evt) {
if (binding.value(evt, el)) {
window.removeEventListener('scroll', f);
}
};
window.addEventListener('scroll', f);
}
});
Vue.mixin({
methods: {
handleScroll: function(evt, el) {
if (window.scrollY > 100) {
el.setAttribute(
'class',
'navbar navbar-light navbar-expand-lg fixed-top navbar-shrink'
);
} else {
el.setAttribute(
'class',
'navbar navbar-light navbar-expand-lg fixed-top'
);
}
//return window.scrollY > 100;
}
}
});
async function main() {
//await store.dispatch('init');
//setHttpHeaders();
/* eslint-disable no-new */
window.App = new Vue({
el: '#app',
store,
router,
components: { App, AppFooter, SignalRTrips }
});
}
main();