Checkout stepper reset address and agency value when changin method

This commit is contained in:
William Buezas 2024-11-27 21:25:11 -03:00
parent 26320f098f
commit 3ddf73c958
1 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,5 @@
<script setup>
import { ref, onMounted, inject, computed } from 'vue';
import { ref, onMounted, inject, computed, watch } from 'vue';
import { useI18n } from 'vue-i18n';
import { useRoute, useRouter } from 'vue-router';
@ -309,6 +309,14 @@ onMounted(async () => {
getAddresses();
});
watch(
() => orderForm.value.method,
() => {
orderForm.value.address = '';
orderForm.value.agency = '';
}
);
</script>
<template>