-
+
- {{value}} / {{valueMax}}
+ {{value}} / {{maxValue}}
@@ -64,8 +64,7 @@
}},
props: {
value: Number,
- valueMax: Number,
- update: Function,
+ maxValue: Number,
},
methods: {
edit(){
@@ -81,16 +80,12 @@
},
commitEdit(){
this.editing = false;
- const value = +this.$refs.editInput.lazyValue;
- let type = "set";
- if (this.operation === 0){
- type = "increment";
- } else if (this.operation === 1){
- type = "decrement";
- }
- if (this.update){
- this.update({type, value});
+ let value = +this.$refs.editInput.lazyValue;
+ let type = this.operation === null ? 'set' : 'increment';
+ if (this.operation === 1){
+ value = -value;
}
+ this.$emit('change', {type, value});
},
rejectNonNumbers: function(evt) {
evt = (evt) ? evt : window.event;