Commit 654b6802 by 吕海涛

11

parent 58abde48
...@@ -9,7 +9,7 @@ import animated from 'animate.css' ...@@ -9,7 +9,7 @@ import animated from 'animate.css'
import VueRouter from 'vue-router' import VueRouter from 'vue-router'
import md5 from 'js-md5'; import md5 from 'js-md5';
import VueAMap from "vue-amap"; import VueAMap from "vue-amap";
import {VueJsonp} from 'vue-jsonp' import { VueJsonp } from 'vue-jsonp'
import echarts from 'echarts' import echarts from 'echarts'
import common from '@/assets/js/common.js' import common from '@/assets/js/common.js'
import * as custom from '@/views/components/common/times.js' import * as custom from '@/views/components/common/times.js'
...@@ -30,7 +30,7 @@ VueAMap.initAMapApiLoader({ ...@@ -30,7 +30,7 @@ VueAMap.initAMapApiLoader({
], ],
v: '1.4.13' v: '1.4.13'
}) })
Vue.prototype.common=common; Vue.prototype.common = common;
Vue.use(VueAMap); Vue.use(VueAMap);
Vue.use(animated) Vue.use(animated)
Vue.use(VueJsonp) Vue.use(VueJsonp)
...@@ -38,7 +38,7 @@ Vue.use(ElementUI) ...@@ -38,7 +38,7 @@ Vue.use(ElementUI)
Vue.use(VueClipboard) Vue.use(VueClipboard)
Vue.config.productionTip = false Vue.config.productionTip = false
Vue.prototype.$md5 = md5 Vue.prototype.$md5 = md5
// 对Router原型链上的push、replace方法进行重写,这样就不用每次调用方法都要加上catch 防止控制台出现Uncaught (in promise) undefined报错 // 对Router原型链上的push、replace方法进行重写,这样就不用每次调用方法都要加上catch 防止控制台出现Uncaught (in promise) undefined报错
const routerPush = VueRouter.prototype.push const routerPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) { VueRouter.prototype.push = function push(location) {
return routerPush.call(this, location).catch(error => error) return routerPush.call(this, location).catch(error => error)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment