fix column filter not working
This commit is contained in:
@@ -26,7 +26,10 @@
|
||||
</q-card>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
|
||||
// initialized only after first mount
|
||||
const isMounted = ref(false);
|
||||
|
||||
const props = defineProps({
|
||||
columnFilter: String,
|
||||
@@ -42,6 +45,18 @@ const columnFilter = computed({
|
||||
set: (v) => emit('update:columnFilter', v),
|
||||
});
|
||||
|
||||
//reset column option
|
||||
watch(
|
||||
() => props.columnFilter,
|
||||
() => {
|
||||
if (!isMounted.value) {
|
||||
isMounted.value = true;
|
||||
return;
|
||||
}
|
||||
emit('update:columnOption', []); // reset properly
|
||||
},
|
||||
);
|
||||
|
||||
const columnOption = computed({
|
||||
get: () => props.columnOption,
|
||||
set: (v) => emit('update:columnOption', v),
|
||||
|
||||
Reference in New Issue
Block a user