Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lesson 90: forEach does not work #14

Closed
TurnFriendly opened this issue Feb 6, 2022 · 1 comment
Closed

lesson 90: forEach does not work #14

TurnFriendly opened this issue Feb 6, 2022 · 1 comment

Comments

@TurnFriendly
Copy link

Hi Shaun,
I struggle with iterarting to the posts array in the composable useTags.js. It throws an unhandled execption:
[Vue warn]: Unhandled error during execution of setup function
at <TagCloud key=1 posts= (5) [{…}, {…}, {…}, {…}, {…}] >
at <Index onVnodeUnmounted=fn ref=Ref< Proxy {…} > >
at <BaseTransition mode="out-in" appear=false persisted=false ... >
at
at
at
at
at
at <BaseTransition mode="out-in" appear=false persisted=false ... >
at
at
at
at

I am using Nuxt3. Code sample:
const useTags = (posts) => {

const tags = ref([])
const tagSet = new Set()

posts.forEach(item => {
item.tags.forEach(tag => tagSet.add(tag))
})

tags.value = [...tagSet]

return { tags }

}

export default useTags

Hope it is ok to get in touch with you by opening an issue.

@TurnFriendly TurnFriendly changed the title lesson 90: forEach doesnot work lesson 90: forEach does not work Feb 6, 2022
@TurnFriendly
Copy link
Author

the problem was, that I did not pass posts as props.post from the TagCloud component

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant