@liximomo (related to #13) It would be great if we could do like this:
# compoennt.js
export default createComponent({
setup() {
const a = value(1)
return () => <div> { a } </div>
})
This would make all type inference and refactoring super easy within VSCode.
I don't think that's what setup() is meant to be, for components, since template is a separate option.
Also value unwrapping isn't clear here.
@phiter it's part of the RFC
https://github.com/vuejs/rfcs/blob/function-apis/active-rfcs/0000-function-api.md#usage-with-manual-render-functions
Oh I see. You gotta access values with .value inside the jsx then.
You don't necessarily have too use .value it's only when you use the value() wrapper. If you use state or anything that doesn't use .value then you don't need too. It's just that the example used a value() and this requires a .value
@IceSentry I am afraid that computed needs .value just like value.
Yes, you are right, I didn't check the RFC before posting, my point still stands that .value is not related to render functions. It's just that the example used that particular value() wrapper.
Supported in v2.2.0
Most helpful comment
Supported in v2.2.0