8355-testToMaster #1177

Merged
alexm merged 326 commits from 8355-testToMaster into master 2025-01-07 06:46:55 +00:00
4 changed files with 9 additions and 7 deletions
Showing only changes of commit cc4295e722 - Show all commits

View File

@ -38,6 +38,10 @@ const $props = defineProps({
type: Boolean,
default: true,
},
keepData: {
type: Boolean,
default: true,
},
});
const sectionValue = computed(() => $props.section ?? $props.dataKey);
@ -46,6 +50,7 @@ onBeforeMount(() => {
if ($props.dataKey)
arrayData = useArrayData($props.dataKey, {
searchUrl: 'table',
keepData: $props.keepData,
...$props.arrayDataProps,
navigate: $props.redirect,
});

View File

@ -111,14 +111,9 @@ onMounted(async () => {
mounted.value = true;
});
// onBeforeRouteUpdate((to, from, next) => {
// if (to.name === from.name && to.path !== from.path) {
// arrayData.reset(['data']);
// }
// next();
// });
onBeforeUnmount(() => {
console.log('store.keepData: ', store.keepData);
if (!store.keepData) arrayData.reset(['data']);
arrayData.resetPagination();
});

View File

@ -53,6 +53,7 @@ export function useArrayData(key = useRoute().meta.moduleName, userOptions) {
'searchUrl',
'navigate',
'mapKey',
'keepData',
];
if (typeof userOptions === 'object') {
for (const option in userOptions) {

View File

@ -18,6 +18,7 @@ export const useArrayDataStore = defineStore('arrayDataStore', () => {
navigate: null,
page: 1,
mapKey: 'id',
keepData: false,
};
function get(key) {