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

docs: update seo and meta page #19697

Merged
merged 2 commits into from Mar 15, 2023
Merged

docs: update seo and meta page #19697

merged 2 commits into from Mar 15, 2023

Conversation

dosstx
Copy link
Contributor

@dosstx dosstx commented Mar 15, 2023

Add the await keyword before useFetch. useFetch is an asynchronous function that returns a Promise, so you need to use the await keyword to wait for the Promise to resolve before assigning its value to the post variable. This ensures that the data is available before it is used in the useServerSeoMeta function.

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Add the `await` keyword before `useFetch`. useFetch is an asynchronous function that returns a Promise, so you need to use the await keyword to wait for the Promise to resolve before assigning its value to the post variable. This ensures that the data is available before it is used in the useServerSeoMeta function.
@codesandbox
Copy link

codesandbox bot commented Mar 15, 2023

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@dosstx
Copy link
Contributor Author

dosstx commented Mar 15, 2023

On second thought probably don't need to use AWAIT here since it's a computed getter.

@Atinux Atinux self-requested a review March 15, 2023 10:42
@Atinux
Copy link
Member

Atinux commented Mar 15, 2023

Thank you @dosstx

Actually I thought about it as well, but for the useSeoMeta example, I believe useFetch is not the right example.

Will update your PR to improve the example.

See my demo on https://stackblitz.com/edit/github-vlzrtd?file=app.vue

@Atinux Atinux changed the title Update 5.seo-meta.md docs: update 5.seo-meta.md Mar 15, 2023
@Atinux
Copy link
Member

Atinux commented Mar 15, 2023

@danielroe danielroe changed the title docs: update 5.seo-meta.md docs: update seo and meta page Mar 15, 2023
@danielroe danielroe merged commit 451b55d into nuxt:main Mar 15, 2023
1 check passed
@danielroe danielroe mentioned this pull request Mar 23, 2023
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

Successfully merging this pull request may close these issues.

None yet

3 participants