refactor: แก้เงื่อนไข

This commit is contained in:
Net 2024-07-05 15:13:39 +07:00
parent 2296a65c80
commit ea4234a313

View file

@ -4,6 +4,7 @@ import { CustomerBranchCreate } from 'stores/customer/types';
defineProps<{
readonly?: boolean;
edit?: boolean;
}>();
const customerBranch = defineModel<CustomerBranchCreate[]>('customerBranch', {
@ -94,6 +95,7 @@ function close(index: number) {
:key="index"
:name="index"
:label="`${$t('customerBranchFormTab')} `"
:disable="tab !== index && edit"
@click="tab = index"
no-caps
:class="tab === index ? '' : 'bordered-b bordered-r'"
@ -116,7 +118,9 @@ function close(index: number) {
<q-tab-panels v-model="tab" class="rounded-borders">
<q-tab-panel
:id="`tab-branch-${index}`"
v-for="(v, index) in customerBranch"
v-for="(v, index) in customerBranch.sort(
(a, b) => (a.branchNo ?? 0) - (b.branchNo ?? 0),
)"
:key="index"
:name="index"
>