main.js
1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import Vue from 'vue'
import App from './App'
import store from './store/index';
Vue.prototype.$store = store;
//配置
import config from './config.js'
Vue.prototype.$conf = config
import {
popUp as wx
} from '@/js_sdk/popUp-tips/popUpTips/index.js';
Vue.prototype.$wx = wx('../../static/demo/demo.png'); //加载动画的图片地址
import api from './common/http/index.js'
Vue.prototype.$api = api
import {
getDicts
} from "./common/http/dict";
Vue.prototype.getDicts = getDicts
Vue.prototype.$prePage = () => {
let pages = getCurrentPages();
let prePage = pages[pages.length - 2];
return prePage.$vm;
}
Vue.directive('enterNumber', {
inserted: function(el) {
el.addEventListener("keypress", function(e) {
e = e || window.event;
let charcode = typeof e.charCode == 'number' ? e.charCode : e.keyCode;
let re = /\d/;
if (!re.test(String.fromCharCode(charcode)) && charcode > 9 && !e.ctrlKey) {
if (e.preventDefault) {
e.preventDefault();
} else {
e.returnValue = false;
}
}
});
}
})
import {
formatTime,
formatDate,
selectDictLabel,
selectCommonLabel,
unique
} from './common/util.js'
Vue.prototype.formatTime = formatTime
Vue.prototype.formatDate = formatDate
Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectCommonLabel = selectCommonLabel
Vue.prototype.unique = unique
import uniIcons from "@/components/uni-icons/uni-icons.vue"
Vue.component('uniIcons', uniIcons)
import appupgrade from './common/appupgrade.js'
Vue.prototype.$appUpgrade = appupgrade
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
...App
})
app.$mount()