fix column filter not working
This commit is contained in:
@@ -26,7 +26,10 @@
|
|||||||
</q-card>
|
</q-card>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<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({
|
const props = defineProps({
|
||||||
columnFilter: String,
|
columnFilter: String,
|
||||||
@@ -42,6 +45,18 @@ const columnFilter = computed({
|
|||||||
set: (v) => emit('update:columnFilter', v),
|
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({
|
const columnOption = computed({
|
||||||
get: () => props.columnOption,
|
get: () => props.columnOption,
|
||||||
set: (v) => emit('update:columnOption', v),
|
set: (v) => emit('update:columnOption', v),
|
||||||
|
|||||||
Reference in New Issue
Block a user