Tracking de l'application VApp (IHM du jeu)

This commit is contained in:
2025-05-11 18:04:12 +02:00
commit 89e9db9b62
17763 changed files with 3718499 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
// Utilities
import { computed, watch } from 'vue';
import { deepEqual, getCurrentInstance } from "../../../util/index.mjs"; // Types
export function useOptions(_ref) {
let {
page,
itemsPerPage,
sortBy,
groupBy,
search
} = _ref;
const vm = getCurrentInstance('VDataTable');
const options = computed(() => ({
page: page.value,
itemsPerPage: itemsPerPage.value,
sortBy: sortBy.value,
groupBy: groupBy.value,
search: search.value
}));
let oldOptions = null;
watch(options, () => {
if (deepEqual(oldOptions, options.value)) return;
// Reset page when searching
if (oldOptions?.search !== options.value.search) {
page.value = 1;
}
vm.emit('update:options', options.value);
oldOptions = options.value;
}, {
deep: true,
immediate: true
});
}
//# sourceMappingURL=options.mjs.map