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: useHead accepts more types of argument #6
Conversation
Maybe we should disallow using plain object, since sth like |
A reactive object could also act as a plain object on types. const obj = reactive({ title: 'foo' })
useHead(obj) And since we passed it to const title = computed(() => `clicked ${count.value} time`)
useHead({ title }) The case you are talking about is the caveat of Vue's reactivity system itself which developers using Composition API should already aware of. I'd think it's better to have a more concise and flexible API for users to choose from (in some cases there could be all static data as well). What do you think? |
That makes sense 👌 |
But #4 wants the value of |
Looks good to me otherwise, README also needs to updated to reflect changes. |
It should be unwrapped automatically with import { ref } from 'vue'
const title = ref('hi')
const object = ref({ title })
console.log(JSON.stringify(object.value)) // {"title":"hi"}
console.log(object.value.title) // hi |
👌
|
README updated. |
Updated with the last commit, guess it should be good now |
@shipjs prepare |
This makes
useHead
more flexible, resolves #4Plain
Function
Ref / Computed Ref