no message
This commit is contained in:
36
main.js
Normal file
36
main.js
Normal file
@@ -0,0 +1,36 @@
|
||||
import App from './App'
|
||||
import Vue from 'vue'
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
import store from '@/vuex/store.js'
|
||||
|
||||
const app = new Vue({
|
||||
...App,
|
||||
store
|
||||
})
|
||||
|
||||
|
||||
app.$mount()
|
||||
Reference in New Issue
Block a user