-
Notifications
You must be signed in to change notification settings - Fork 100
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
feat: improve the head API #41
Comments
Yes it would be cleaner. If we can get your API we can also remove head. But that is currently not posible as far as I know... |
I think we could produce a modified |
Maybe we can add a |
This improves the `useMeta()` helper by removing the need to pass `head` into `defineComponent`. Instead, a helper function is injected into components that can then be hooked into by `useMeta`. BREAKING CHANGE: `useHead()` no longer exists and instead `useMeta` can be used directly within `setup`, as long as a minimal `head: {}` is defined in the component options. _Note_: Work has already begun on composable hooks for `vue-meta` that will mean we don't need to define a minimal `head` object: see [here](5d0eb1ab60ce476ed8a97e97d4d409e74284df9b). Closes #41
What other use cases are you talking about? I cannot find any information regarding a modified |
see https://github.com/nuxt-community/composition-api/blob/main/src/runtime/composables/component.ts we don't reexport the defineComponent function from @vue/composition-api but extend it with some logic for the head. Other usecases / ideas got droped. |
Currently according to the README
useHead()
is being used outside of the component.Usually functions starting with useXXX are composition API used inside components.
Which to me, I think it might cause confusion.
I think the API would be cleaner like the following, but not sure if the implementation is possible.
Just giving my opinion.
The text was updated successfully, but these errors were encountered: