-
Notifications
You must be signed in to change notification settings - Fork 548
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
The better way to code。 #114
Comments
I proposed exactly the same previously. But then after using the API for a while it became clear to me that ref is amazing. |
There is nothing to stop you from coding in that style tho. Feel free to do whatever you prefer? |
One big thing that does not work with const state = reactive({
a: 1,
b: 2,
c: computed(() => {
return state.a * state.b
})
}) And even though everyone seem to embrace better TypeScript support - all the examples don't use it or just use So if you need TypeScript you either get used to write |
To be precise - it compiles, but state has type any (so no point in using TypeScript) - |
The |
Basic example
The usage of
.value
is easy to make Bug.So I think the better way is like this.
No more
.value
,just likestate
instead ofthis
in vue2.The text was updated successfully, but these errors were encountered: