forked from littlematch0123/blog-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
32 lines (30 loc) · 747 Bytes
/
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
import Vue from 'vue'
import VueLazyload from 'vue-lazyload'
import App from './App'
import createRouter from './router'
import createStore from './store'
import async from './utils/async'
Vue.use(async)
Vue.use(VueLazyload, {
loading: require('./assets/imgs/loading.gif'),
listenEvents: ['scroll'],
filter: {
webp(listener, options) {
if (!options.supportWebp) return
const isCDN = /xiaohuochai.site/
if (isCDN.test(listener.src)) {
listener.src += '?imageView2/2/format/webp'
}
}
}
})
export default function createApp() {
const router = createRouter()
const store = createStore()
const app = new Vue({
router,
store,
render: h => h(App)
})
return { app, router, store }
}