1
1
<template >
2
2
<div
3
3
class =" pvtFilterBox"
4
- :style =" { display: block, cursor: initial, zIndex: props.zIndex}"
4
+ :style =" { display: ' block' , cursor: ' initial' , zIndex: props.zIndex}"
5
5
@click =" moveFilterBoxToTop"
6
6
>
7
7
<div
51
51
type =" checkbox"
52
52
:checked =" !(x in unselectedValues)"
53
53
>
54
- <template v-html =" x " ></template >
54
+ {{ x }}
55
+ <span >({{ filterBoxValues[x] }})</span >
55
56
<a
56
57
class =" pvtOnly"
57
58
@click =" selectOnly($event, x)"
68
69
</template >
69
70
70
71
<script setup>
71
- import { ref , computed , inject } from ' vue'
72
- const sorters = inject (' sorters' )
73
- const menuLimit = inject (' menuLimit' )
74
- const localeStrings = inject (' localeStrings' )
72
+ import { ref , computed } from ' vue'
73
+ import { useProvideFilterBox } from ' ../../composables'
75
74
const props = defineProps ({
76
75
unselectedFilterValues: {
77
76
type: Object ,
@@ -90,10 +89,12 @@ const props = defineProps({
90
89
default : () => ({})
91
90
}
92
91
})
92
+ const { localeStrings , sorter , menuLimit } = useProvideFilterBox ()
93
+ console .log (localeStrings)
93
94
const filterBoxValuesList = Object .keys (props .filterBoxValues )
94
95
const filterText = ref (' ' )
95
96
const showMenu = ref (filterBoxValuesList .length < menuLimit)
96
- const sortedList = [... filterBoxValuesList].sort (sorters (props .filterBoxKey ))
97
+ const sortedList = [... filterBoxValuesList].sort (sorter (props .filterBoxKey ))
97
98
const filteredList = computed (() => sortedList .filter (matchesFilter))
98
99
const unselectedValues = ref (props .unselectedFilterValues )
99
100
const emit = defineEmits ([
0 commit comments