Filter await useFetch
Hi I am new to Nuxt and all the javascript frameworks out there. I am trying to pull data and then filter it on the page. However when I try to run .filter on questions it comes back stating that questions doesn't have a method named .filter() I see that it returns a Ref<SerializedObject> but how would I get this to work as expected?
4 Replies
questions
is a ref
so you have to use questions.value
Also be aware that questions
can be null in case of an error. You should see that when hovering over the variable.Even when I have questions.value it shows
I tried that to begin with but when it continued to show an error and wouldn't load the page I tried searching deeper but couldn't find anything
ive tried wrapping it in a null check as well.
question.value?.filter should work fine 😉
also make sure you return questions.value further up