fix: sort selected field

This commit is contained in:
Methapon2001 2024-12-10 14:22:15 +07:00
parent eaa92f214d
commit 42585c859c
2 changed files with 25 additions and 11 deletions

View file

@ -101,11 +101,19 @@ defineProps<{
<slot name="data"></slot>
<template v-if="!$slots.data">
<div
v-for="key in fieldSelected || [
'branchLabelAddress',
'branchLabelTel',
'branchLabelType',
]"
v-for="key in (
fieldSelected || [
'branchLabelAddress',
'branchLabelTel',
'branchLabelType',
]
).sort((lhs, rhs) => {
let order = Object.keys(data);
return (
order.findIndex((i) => i === lhs) -
order.findIndex((i) => i === rhs)
);
})"
:key="key"
class="branch-card__data"
>