18 lines
380 B
JavaScript
18 lines
380 B
JavaScript
|
import Vue from 'vue'
|
||
|
import Api from '../api/index'
|
||
|
import dayjs from 'dayjs'
|
||
|
import './style/index.less'
|
||
|
Vue.prototype.$api=Api;
|
||
|
Vue.prototype.$bus=new Vue();
|
||
|
Vue.prototype.$apiPath="/jhapi"
|
||
|
Vue.prototype.$dt=dayjs;
|
||
|
Vue.prototype.$tryToJson=(str,def=null)=>{
|
||
|
if(!str){
|
||
|
return def;
|
||
|
}
|
||
|
try{
|
||
|
return JSON.parse(str);
|
||
|
}catch(e){
|
||
|
return def;
|
||
|
}
|
||
|
}
|