49 lines
1.4 KiB
JavaScript
49 lines
1.4 KiB
JavaScript
// 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 App from './App'
|
|
import router from './router'
|
|
import Vconsole from 'vconsole'
|
|
import vant, { Locale } from 'vant'
|
|
import 'vant/lib/index.css'
|
|
import enUS from 'vant/lib/locale/lang/en-US'
|
|
import 'lib-flexible/flexible'
|
|
import VueClipboard from 'vue-clipboard2'
|
|
import { getAppInfoFromClient } from '@/utils/getAppInfo.js'
|
|
import i18n from './lang'
|
|
import './styles/index.css'
|
|
getAppInfoFromClient()
|
|
Vue.config.productionTip = false
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
// eslint-disable-next-line no-new
|
|
new Vconsole()
|
|
}
|
|
Vue.use(vant)
|
|
Locale.use('en-US', enUS)
|
|
Vue.use(VueClipboard)
|
|
|
|
Vue.prototype.$commonUrl = 'https://yumi-static'
|
|
|
|
function setRem() {
|
|
document.documentElement.style.position = 'relative'
|
|
document.documentElement.style.margin = 'auto'
|
|
const width = document.documentElement.clientWidth > 540 ? 540 : document.documentElement.clientWidth
|
|
document.documentElement.style.fontSize = (width / 10) + 'px'
|
|
document.documentElement.style.width = width + 'px'
|
|
}
|
|
|
|
window.addEventListener('resize', setRem)
|
|
setRem() // 初始化时设置
|
|
/* eslint-disable no-new */
|
|
new Vue({
|
|
el: '#app',
|
|
router,
|
|
i18n,
|
|
components: { App },
|
|
template: '<App/>'
|
|
})
|
|
|
|
|
|
|
|
// WEBPACK FOOTER //
|
|
// ./src/main.js
|