You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
like this, but this is a provided using nuxt useFetch
constfetchPosts=async()=>{const{data: posts}: any=awaituseFetch('/items/posts',{params: {limit: 6asnumber,// maximum returnedpage: 1,meta: 'filter_count',},})// this will return limit 6console.log('limit:',posts.value.data.length)// Suppose the total quantity is 39 this will return 39console.log('total:',posts.value.meta.filter_count)}fetchPosts()
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Although the meta parameter can be used.
but
getItems()
only get the value in 'data'how can i get
filter_count
value withgetItems()
,I hope to get the same with
getItems()
like this, but this is a provided using nuxt
useFetch
Thank you for your help
Beta Was this translation helpful? Give feedback.
All reactions