Skip to content

Commit

Permalink
rate: add disable keydown event option for rate
Browse files Browse the repository at this point in the history
  • Loading branch information
shichao wang committed Oct 22, 2020
1 parent 649670c commit 56c19ae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/rate/src/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@
scoreTemplate: {
type: String,
default: '{value}'
},
keydownDisabled: {
type: Boolean,
default: false
}
},
Expand Down Expand Up @@ -277,7 +281,7 @@
},
handleKey(e) {
if (this.rateDisabled) {
if (this.rateDisabled || this.keydownDisabled) {
return;
}
let currentValue = this.currentValue;
Expand Down
3 changes: 3 additions & 0 deletions types/rate.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,7 @@ export declare class ElRate extends ElementUIComponent {

/** Text template when the component is read-only */
scoreTemplate: string

/** Whether Keydown Event is disabled */
keydownDisabled: boolean
}

0 comments on commit 56c19ae

Please sign in to comment.