Search code examples
arrayssortingcheckboxvuejs3pinia

How to get this checkbox filter code to work?


I am trying to get this checkbox filter to return the "filteredTracks"

Here is the script:

<script setup>
import SongRow from "../components/SongRow.vue";
import Magnify from "../components/Magnify.vue";
import Play from "../components/Play.vue";

Solution

  • const selectedGenres = ref([])
    const selectedMoods = ref([])
    const selectedTempos = ref([])
    const selectedThemes = ref([])
    const search = ref('')
    
    const filteredTracks = computed(() => {
    

    This was how I solved this for anyone with the same issue... Just repeat the checkboxes for selectedMoods, selectedTempos, selectedThemes.