In my scenario, there are two important objects - dropdownOptions
and totalItem
https://i.sstatic.net/VreXd.png
The requirement is as follows:
- If
12 < totalItems < 24
, then display "Show 12, Show 24" - If
24 < totalItems < 36
, only show "Show 12, Show 24, Show 36"
This pattern continues. I attempted to use a computed property, but struggling with how to implement these conditions within the object.
const dropdownOptions = {
12: "Show 12",
24: "Show 24",
36: "Show 36",
48: "Show 48",
}
const totalItem = 19
const dropdownOptionFiltered = computed(() => {
if (dropdownOptions) {}
return dropdownOption
})