forked from didi/mand-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.bundle.js
40 lines (33 loc) · 1008 Bytes
/
main.bundle.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
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import VueRouter from 'vue-router'
import routes from './route'
import App from './App'
import FastClickDefault, {FastClick} from 'fastclick'
import '../components/_style/global.styl'
import './theme.custom.styl'
import mandMobile from '../lib/mand-mobile.umd'
import '../lib/mand-mobile.css'
const _attach = FastClickDefault.attach || FastClick.attach
if ('ontouchstart' in window) {
_attach(document.body)
}
Vue.config.productionTip = false
Vue.use(VueRouter)
Vue.use(mandMobile)
const isProd = process.env.NODE_ENV === 'production'
const router = new VueRouter({
mode: 'hash',
base: isProd ? '/mand-mobile/examples' : '',
routes,
})
router.afterEach(route => {
document.title = route.name ? `${route.name}-Mand Mobile` : 'Mand Mobile'
})
/* eslint-disable no-new */
new Vue({
el: '#app',
render: h => h(App),
router,
})