123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- import Vue from 'vue'
- import App from './App.vue'
- import router from './router'
- import vueEsign from 'vue-esign'
- import './assets/css/reset.css'
- import './assets/css/common.css'
- import './components/icon/index'
- import Loading from './components/loading'
- import toast from './components/toast'
- import './JS/plugin'
- import './JS/FastClick'
- import 'vant/lib/index.css'
- import filters from './JS/filter'
- import utils from './JS/utils'
- import VueScroller from 'vue-scroller'
- import { get, post, http } from './JS/ajax'
- import './vant'
- import vConsole from './JS/vconsole'
- Vue.use(VueScroller)
- Vue.use(utils)
- Vue.use(vueEsign)
- Vue.prototype.$loading = Loading
- Vue.prototype.$toast = toast
- Vue.prototype.$http = { get, post, http }
- // 注入全局过滤器
- Object.keys(filters).forEach(item => {
- Vue.filter(item, filters[item])
- })
- function initRem () {
- const cale = window.screen.availWidth > 750 ? 2 : window.screen.availWidth / 375
- window.document.documentElement.style.fontSize = `${100 * cale}px`
- }
- window.addEventListener('resize', function () {
- initRem()
- })
- Vue.config.productionTip = false
- router.beforeEach((to, from, next) => {
- document.title = to.meta.title
- const userInfo = localStorage.getItem('token') || null
- if (!userInfo && to.meta.auth) {
- next('/')
- } else {
- next()
- }
- })
- export default new Vue({
- el: '#app',
- router,
- render: h => h(App)
- })
|