Browse Source

fix(stepper): callback event and value

famanoder 6 years ago
parent
commit
4307e767db
2 changed files with 7 additions and 7 deletions
  1. 4 4
      src/packages/stepper/demo.vue
  2. 3 3
      src/packages/stepper/stepper.vue

+ 4 - 4
src/packages/stepper/demo.vue

@@ -68,11 +68,11 @@ export default {
     }
   },
   methods: {
-    focus(v) {
-      // console.log('focus,', v)
+    focus(e, v) {
+      console.log('focus,', e, v)
     },
-    blur(v) {
-      // console.log('focus,', v)
+    blur(e, v) {
+      console.log('blur,', e, v)
     },
     add() {
       this.val1 = Number(this.val1) + 1;

+ 3 - 3
src/packages/stepper/stepper.vue

@@ -126,10 +126,10 @@ export default {
             this.minNum = '';
             // this.num = '';
             this.focusing = true;
-            this.$emit('focus', this.num);
+            this.$emit('focus', e, this.num);
         },
         blur(e) {
-            if(this.readonly) return this.$emit('focus', this.num);
+            if(this.readonly) return this.$emit('blur', e, this.num);
             let v = e.target.value;
             this.minNum = this.min;
             this.focusing = false;
@@ -140,7 +140,7 @@ export default {
             }else{
                 this.num = this.tempNum;
             }
-            this.$emit('focus', this.num);
+            this.$emit('blur', e, this.num);
         },
         checknum(e) {
             let v = e.target.value;