fix marking bug - when typing chinese

This commit is contained in:
Jack Goh
2018-08-13 12:07:15 +08:00
parent 148f771098
commit 796e8bf6df
4 changed files with 9 additions and 17 deletions
+1 -7
View File
@@ -8,7 +8,7 @@
<div class="form-group row">
<label class="col-md-3 col-form-label text-md-right">{{ $t('Marking') }}</label>
<div class="col-md-7">
<input style="text-transform: uppercase;" v-model="form.marking" :class="{ 'is-invalid': form.errors.has('marking') }" class="form-control" @input="forceUppercase($event, form, 'marking')" type="text" name="marking">
<input v-model="form.marking" :class="{ 'is-invalid': form.errors.has('marking') }" class="form-control" type="text" name="marking">
<has-error :form="form" field="marking"/>
</div>
</div>
@@ -108,12 +108,6 @@ export default {
methods: {
forceUppercase(e, o, prop) {
const start = e.target.selectionStart;
e.target.value = e.target.value.toUpperCase();
this.$set(o, prop, e.target.value);
e.target.setSelectionRange(start, start);
},
async register () {
var token
var data
@@ -19,7 +19,7 @@
<el-form ref="markingForm" :model="markingForm" :rules="rules">
<div align="right">
<el-form-item label="Marking" prop="marking">
<input style="width: 80%; text-transform: uppercase;" v-model="markingForm.marking" class="form-control" @input="forceUppercase($event, markingForm, 'marking')" type="text" />
<input style="width: 80%" v-model="markingForm.marking" class="form-control" type="text" />
</el-form-item>
<el-form-item label="Email" prop="email">
<el-input v-model="markingForm.email" type="text" style="width: 80%" />
@@ -109,12 +109,6 @@
this.UpdateTableData();
},
methods: {
forceUppercase(e, o, prop) {
const start = e.target.selectionStart;
e.target.value = e.target.value.toUpperCase();
this.$set(o, prop, e.target.value);
e.target.setSelectionRange(start, start);
},
CreateMarking : function(formName){
this.loading_btn = true
this.AddDatadialogVisible = false;