Reset current page to 1 on collection switch

Ref #3176
This commit is contained in:
rijkvanzanten
2020-11-27 19:49:52 -05:00
parent 100937c2dd
commit bf45a08c37

View File

@@ -326,6 +326,12 @@ export default defineComponent({
function useItemOptions() {
const page = ref(1);
watch(
() => props.collection,
() => (page.value = 1),
{ immediate: true }
);
const sort = computed({
get() {
return _layoutQuery.value?.sort || primaryKeyField.value?.field;