feat: ตรวจสอบเปลี่ยนจังหวัด ให้ล้างค่าเก่า
This commit is contained in:
parent
b3a25513e3
commit
21dc987291
1 changed files with 10 additions and 0 deletions
|
|
@ -63,6 +63,7 @@ watch(provinceId, async (v) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(districtId, async (v) => {
|
watch(districtId, async (v) => {
|
||||||
|
subDistrictId.value = undefined;
|
||||||
await fetchSubDistrict(v);
|
await fetchSubDistrict(v);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -72,6 +73,15 @@ watch(subDistrictId, async (v) => {
|
||||||
?.filter((x) => x.id === v)
|
?.filter((x) => x.id === v)
|
||||||
.map((x) => x.zipCode)[0] ?? '';
|
.map((x) => x.zipCode)[0] ?? '';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
watch(provinceId, (v) => {
|
||||||
|
if (v) {
|
||||||
|
addrOptions.value.districtOps = [];
|
||||||
|
addrOptions.value.subDistrictOps = [];
|
||||||
|
districtId.value = undefined;
|
||||||
|
subDistrictId.value = undefined;
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<q-dialog full-width v-model="modal">
|
<q-dialog full-width v-model="modal">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue