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