-
- {{ entity[title] ?? $props.title }}
+
+ {{ getValueFromPath(title) ?? $props.title }}
@@ -151,7 +166,7 @@ const emit = defineEmits(['onFetch']);
- #{{ $props.subtitle ?? entity.id }}
+ #{{ getValueFromPath(subtitle) ?? entity.id }}
diff --git a/src/composables/useArrayData.js b/src/composables/useArrayData.js
index b40699bbb..f8412f33a 100644
--- a/src/composables/useArrayData.js
+++ b/src/composables/useArrayData.js
@@ -198,6 +198,13 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
function updateStateParams() {
const newUrl = { path: route.path, query: { ...(route.query ?? {}) } };
newUrl.query[store.searchUrl] = JSON.stringify(store.currentFilter);
+ const { matched: matches } = router.currentRoute.value;
+ const { path } = matches.at(-1);
+
+ const to =
+ store?.data?.length === 1
+ ? path.replace(/\/(list|:id)|-list/, `/${store.data[0].id}`)
+ : path.replace(/:id.*/, '');
if (store.navigate) {
const { customRouteRedirectName, searchText } = store.navigate;
@@ -206,13 +213,6 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
name: customRouteRedirectName,
params: { id: searchText },
});
- const { matched: matches } = router.currentRoute.value;
- const { path } = matches.at(-1);
-
- const to =
- store?.data?.length === 1
- ? path.replace(/\/(list|:id)|-list/, `/${store.data[0].id}`)
- : path.replace(/:id.*/, '');
if (route.path != to) {
const pushUrl = { path: to };
@@ -223,7 +223,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
}
}
- router.replace(newUrl);
+ if (store.currentFilter?.search) router.replace({ ...newUrl, path: to });
}
const totalRows = computed(() => (store.data && store.data.length) || 0);