Skip to content

Commit

Permalink
refactor: Align event names with the standard input events
Browse files Browse the repository at this point in the history
  • Loading branch information
rkunev committed Dec 23, 2018
1 parent 2220de1 commit 2709b1f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<color-picker v-bind="color" @change="onChange" />
<color-picker v-bind="color" @input="onInput" />
</template>

<script>
Expand All @@ -18,8 +18,8 @@
};
},
methods: {
onChange(hue) {
this.hue = hue;
onInput(hue) {
this.color.hue = hue;
},
},
};
Expand Down
4 changes: 2 additions & 2 deletions src/ColorPicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
this.updateColor(rotator.angle);
},
updateColor(hue) {
this.$emit('change', hue);
this.$emit('input', hue);
},
rotateToMouse(ev) {
if (this.isPressed || !this.isKnobIn)
Expand All @@ -143,7 +143,7 @@
this.isPressed = true;
if (this.isPaletteIn && this.isKnobIn) {
this.$emit('select', this.hue);
this.$emit('change', this.hue);
this.isRippling = true;
} else {
this.isPaletteIn = true;
Expand Down

0 comments on commit 2709b1f

Please sign in to comment.