mirror of
http://112.124.100.131/GFRS/ebiz-h5.git
synced 2025-12-16 15:46:44 +08:00
95 lines
2.3 KiB
JavaScript
95 lines
2.3 KiB
JavaScript
import Vue from 'vue'
|
|
import App from './App.vue'
|
|
import router from './router'
|
|
import store from './store'
|
|
import Filters from '@/filters'
|
|
import FastClick from 'fastclick'
|
|
import '@/assets/js/utils/validator' //表单校验
|
|
import Jump from '@/assets/js/utils/jump'
|
|
import utils from '@/assets/js/business-common'
|
|
import config from '@/config'
|
|
import noMoreClick from '@/directive/noMoreClick'
|
|
|
|
//全局注册vant常用组件
|
|
import {
|
|
Toast,
|
|
Button,
|
|
Dialog,
|
|
Icon
|
|
} from 'vant'
|
|
|
|
Vue.use(Icon)
|
|
|
|
Vue.use(Toast)
|
|
Vue.use(Button)
|
|
Vue.use(Dialog)
|
|
Vue.prototype.$assetsUrl = config.assetsUrl
|
|
Vue.prototype.$mainUrl = config.mainUrl
|
|
// 全局 防重复点击
|
|
Vue.directive('no-more-click', noMoreClick)
|
|
//解决ios移动端input调软键盘问题
|
|
let isIphone = navigator.userAgent.indexOf('iPhone') != -1
|
|
if (isIphone) {
|
|
FastClick.prototype.focus = function (targetElement) {
|
|
let length
|
|
if (
|
|
isIphone &&
|
|
targetElement.setSelectionRange &&
|
|
targetElement.type.indexOf('date') !== 0 &&
|
|
targetElement.type !== 'time' &&
|
|
targetElement.type !== 'month' &&
|
|
targetElement.type !== 'email'
|
|
) {
|
|
length = targetElement.value.length
|
|
targetElement.setSelectionRange(length, length)
|
|
/*修复bug ios 11.3不弹出键盘,这里加上聚焦代码,让其强制聚焦弹出键盘*/
|
|
targetElement.focus()
|
|
} else {
|
|
targetElement.focus()
|
|
}
|
|
}
|
|
}
|
|
|
|
//router or bridge jump
|
|
Vue.prototype.$jump = Jump
|
|
|
|
Vue.prototype.$utils = utils
|
|
|
|
//混合开发调试工具
|
|
// if (process.env.NODE_ENV == 'development') {
|
|
// // let Eruda = require('eruda')
|
|
// // Eruda.init()
|
|
// Vue.prototype.$rootUrl = location.origin
|
|
// } else if (process.env.NODE_ENV == 'production') {
|
|
// Vue.prototype.$rootUrl = location.origin + '/ebiz-h5'
|
|
// }
|
|
if (process.env.VUE_APP_FLAG != 'prd') {
|
|
let Eruda = require('eruda')
|
|
Eruda.init()
|
|
} else {
|
|
// Vue.prototype.$rootUrl = location.origin + '/ebiz-h5'
|
|
Vue.config.devtools = true
|
|
}
|
|
// let Eruda = require('eruda')
|
|
// Eruda.init()
|
|
|
|
// 注册过滤器
|
|
Object.keys(Filters).forEach(function (k) {
|
|
Vue.filter(k, Filters[k])
|
|
})
|
|
|
|
//权限控制
|
|
import {
|
|
permission
|
|
} from '@/assets/js/utils/permission'
|
|
permission()
|
|
|
|
//ios点击300毫秒时延
|
|
FastClick.attach(document.body)
|
|
|
|
Vue.config.productionTip = false
|
|
new Vue({
|
|
router,
|
|
store,
|
|
render: h => h(App)
|
|
}).$mount('#app') |