!87 添加回车功能

Merge pull request !87 from 德仔/develop
This commit is contained in:
德仔
2021-03-03 14:39:30 +08:00
committed by Gitee
2 changed files with 7 additions and 2 deletions

View File

@ -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>

View File

@ -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,