You've already forked AstralRinth
forked from didirus/AstralRinth
fix SearchFilter.vue (#123)
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, defineProps, defineEmits, watchEffect } from 'vue'
|
import { defineProps, defineEmits, computed } from 'vue'
|
||||||
import { Checkbox } from '@'
|
import { Checkbox } from '@'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -40,13 +40,9 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const isActive = ref(props.activeFilters.value.includes(props.facetName))
|
const isActive = computed(() => props.activeFilters.includes(props.facetName))
|
||||||
const emit = defineEmits(['toggle'])
|
const emit = defineEmits(['toggle'])
|
||||||
|
|
||||||
watchEffect(() => {
|
|
||||||
isActive.value = props.activeFilters.value.includes(props.facetName)
|
|
||||||
})
|
|
||||||
|
|
||||||
const toggle = () => {
|
const toggle = () => {
|
||||||
emit('toggle', props.facetName)
|
emit('toggle', props.facetName)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user