fix: backward compatible

This commit is contained in:
Methapon Metanipat 2024-08-22 14:20:48 +07:00
parent 4d8ff7af8e
commit a4afc54f2e

View file

@ -103,6 +103,14 @@ async function fetchSubDistrict() {
);
}
async function selectSubDistrict(id: string) {
if (!id) return;
zipCode.value =
addrOptions.subDistrictOps
?.filter((x) => x.id === id)
.map((x) => x.zipCode)[0] ?? '';
}
const provinceOptions = ref<Record<string, unknown>[]>([]);
let provinceFilter: (
value: string,
@ -355,6 +363,7 @@ watch(districtId, fetchSubDistrict);
$t('formDialogInputSubDistrictValidate'),
]
"
@update:model-value="(v: string) => selectSubDistrict(v)"
@filter="subDistrictFilter"
>
<template v-slot:no-option>