Browse Source

fix 问题

dusenyao 3 years ago
parent
commit
ed07b72e6d
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/views/teacher/create_course/step_table/CourseInfo.vue

+ 6 - 1
src/views/teacher/create_course/step_table/CourseInfo.vue

@@ -60,7 +60,7 @@
         </el-form-item>
 
         <el-form-item :label="$t('Key254')">
-          <el-input v-model="form.student_count_max" class="student-count" oninput="value=value.replace(/[^\d]/g,'')" />
+          <el-input v-model="form.student_count_max" class="student-count" @input="changeStudent" />
           <el-checkbox v-model="form.is_auto_close">
             {{ $t('Key266') }}
           </el-checkbox>
@@ -303,6 +303,11 @@ export default {
     price(val) {
       this.form.price = twoDecimal(val);
     },
+
+    changeStudent(val) {
+      this.form.student_count_max = val.length === 0 ? '' : Number(val.replace(/[^\d]/g, ''));
+    },
+
     // 对话框方法
     selectTeacher() {
       if (this.form.org_id) {