mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Refactor #5437 - For Rating
This commit is contained in:
parent
8efb1a5eea
commit
aedd31e8e6
6 changed files with 12 additions and 66 deletions
|
@ -106,8 +106,13 @@ export default {
|
|||
this.isFocusVisibleItem = true;
|
||||
},
|
||||
onOptionSelect(event, value) {
|
||||
this.focusedOptionIndex = value;
|
||||
this.updateModel(event, value || null);
|
||||
if (this.focusedOptionIndex === value || this.modelValue === value) {
|
||||
this.focusedOptionIndex = -1;
|
||||
this.updateModel(event, null);
|
||||
} else {
|
||||
this.focusedOptionIndex = value;
|
||||
this.updateModel(event, value || null);
|
||||
}
|
||||
},
|
||||
updateModel(event, value) {
|
||||
this.$emit('update:modelValue', value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue