Files
hht-ftdl-uni/main.js

42 lines
943 B
JavaScript
Raw Normal View History

2025-08-06 16:35:47 +08:00
import App from './App'
import Vue from 'vue'
2025-09-26 15:22:04 +08:00
import i18n from './locale/index.js'
2025-08-06 16:35:47 +08:00
Vue.config.productionTip = false
App.mpType = 'app'
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;
// if (parseInt(e.target.value) == 0) {
// e.preventDefault();
// }
parseInt(e.target.value) == 0 && e.preventDefault();
let re = /\d/;
if(!re.test(String.fromCharCode(charcode)) && charcode > 9 && !e.ctrlKey){
if(e.preventDefault){
e.preventDefault();
}else{
e.returnValue = false;
}
}
});
}
});
Vue.prototype.$getStatusText = function(statusMap, status) {
return statusMap[status] || '';
};
import store from '@/vuex/store.js'
const app = new Vue({
2025-09-26 15:22:04 +08:00
i18n,
2025-08-06 16:35:47 +08:00
...App,
store
})
app.$mount()