添加回车功能
This commit is contained in:
@ -9,6 +9,7 @@
|
|||||||
:step="5"
|
:step="5"
|
||||||
:value="value"
|
:value="value"
|
||||||
@blur="handleOnBlur"
|
@blur="handleOnBlur"
|
||||||
|
@keyup.enter="handleEnterClick"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -34,7 +35,7 @@ export default {
|
|||||||
const { value } = e.target;
|
const { value } = e.target;
|
||||||
if (value > 0) {
|
if (value > 0) {
|
||||||
this.editing = false;
|
this.editing = false;
|
||||||
const mValue = parseFloat(value)
|
const mValue = parseFloat(value);
|
||||||
if (mValue !== parseFloat(this.value)) {
|
if (mValue !== parseFloat(this.value)) {
|
||||||
this.$emit("onChange", mValue);
|
this.$emit("onChange", mValue);
|
||||||
}
|
}
|
||||||
@ -42,6 +43,9 @@ export default {
|
|||||||
this.$message.error("数字必须大于0");
|
this.$message.error("数字必须大于0");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
handleEnterClick(e) {
|
||||||
|
e.target.blur();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -327,9 +327,10 @@ export default {
|
|||||||
this.deleteDishes({ num: this.num, id: data.id });
|
this.deleteDishes({ num: this.num, id: data.id });
|
||||||
},
|
},
|
||||||
handleOnWeightChange(data, weight) {
|
handleOnWeightChange(data, weight) {
|
||||||
console.log({ data, weight });
|
// console.log({ data, weight });
|
||||||
this.updateDishes({
|
this.updateDishes({
|
||||||
num: this.num,
|
num: this.num,
|
||||||
|
id: data.id,
|
||||||
dishesId: data.dishesId,
|
dishesId: data.dishesId,
|
||||||
igdId: data.igdId,
|
igdId: data.igdId,
|
||||||
weight,
|
weight,
|
||||||
|
Reference in New Issue
Block a user