feat($input-number): add events 'on-focus', 'on-blur', 'on-enter' for input-number component
This commit is contained in:
parent
593742afbc
commit
c21a814287
1 changed files with 4 additions and 0 deletions
|
@ -238,9 +238,11 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
focus () {
|
focus () {
|
||||||
|
this.$emit('on-focus');
|
||||||
this.focused = true;
|
this.focused = true;
|
||||||
},
|
},
|
||||||
blur () {
|
blur () {
|
||||||
|
this.$emit('on-blur');
|
||||||
this.focused = false;
|
this.focused = false;
|
||||||
},
|
},
|
||||||
keyDown (e) {
|
keyDown (e) {
|
||||||
|
@ -250,6 +252,8 @@
|
||||||
} else if (e.keyCode === 40) {
|
} else if (e.keyCode === 40) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.down(e);
|
this.down(e);
|
||||||
|
} else if (e.keyCode === 13) {
|
||||||
|
this.$emit('on-enter');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
change (event) {
|
change (event) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue