Skip to content

Commit

Permalink
feat: add key event
Browse files Browse the repository at this point in the history
  • Loading branch information
NightCatSama committed Aug 24, 2018
1 parent 562b3d4 commit b5bd724
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,10 @@ prop*: [only supported in vue2]
### Events
| Name | Type | Description |
| --------------|:--------------|--------------|
| callback | Params: value[Number] | values change when the callback function. (Changes in the direct assignment value will not trigger the callback, it is recommended to use `setValue` method) |
| callback | Params: value[Number | Array] | values change when the callback function. (Changes in the direct assignment value will not trigger the callback, it is recommended to use `setValue` method) |
| drag-start   | Params: context[Object]| Drag the start event |
| drag-end | Params: context[Object]| Drag the end event |
| on-keypress | Params: value[Number | Array]| keyboard event |

### Slot
| Name | Description |
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/dist/build.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions example/src/vue-slider/vue2-slider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,7 @@
syncValue (noCb) {
let val = this.isRange ? this.val.concat() : this.val
this.$emit('input', val)
this.keydownFlag && this.$emit('on-keypress', val)
noCb || this.$emit('callback', val)
},
getValue () {
Expand Down
1 change: 1 addition & 0 deletions src/vue2-slider.vue
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,7 @@
syncValue (noCb) {
let val = this.isRange ? this.val.concat() : this.val
this.$emit('input', val)
this.keydownFlag && this.$emit('on-keypress', val)
noCb || this.$emit('callback', val)
},
getValue () {
Expand Down

0 comments on commit b5bd724

Please sign in to comment.