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

Update samples to use a computed variable for head #225

Merged
merged 4 commits into from
Oct 13, 2020
Merged

Conversation

hmsk
Copy link
Member

@hmsk hmsk commented Sep 22, 2020

  • Class API
  • Options API
  • Composition API -> Need to ask @danielroe how to use computed function on useMeta (looks not supported yet)

Comment on lines 86 to 91
title: 'Composition API Demo',
meta: [{
name: 'message',
content: message.value // It's not reactive
}]
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hmsk Sorry for the delay in replying. I'm afraid this isn't actually that intuitive at the moment. I might need to add the functionality to @nuxtjs/composition-api.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this API look good to you?

nuxt-community/composition-api#255

Copy link
Member Author

@hmsk hmsk Oct 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense for me. useMeta(() => ({})) is intuitive and looks similar to the type of head / head() in options/class API.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a812357 😉

danielroe added a commit to nuxt-community/composition-api that referenced this pull request Oct 9, 2020
* use like `useMeta(() => ({ title: message.value }))` for computed head
* nuxt-community/typescript-template#225

* closes #254
@danielroe
Copy link
Member

@hmsk my proposed api should now be useable in v0.13.0.

@hmsk
Copy link
Member Author

hmsk commented Oct 13, 2020

Thanks, @danielroe for your responsive updates on @nuxt/composition-api!

@hmsk hmsk merged commit 92524e1 into main Oct 13, 2020
@hmsk hmsk deleted the reactive-meta branch October 13, 2020 05:20
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.

2 participants