Personally, I think the syntax of vue2 where method, props, and data are distinguished is better, but I'm curious as to why setup was created.
Personally, I think the syntax of vue2 where method, props, and data are distinguished is better, but I'm curious as to why setup was created.
To be able to bundle reactive data and functions together instead of spreading them out into data, methods, etc.
Here is a good explanation: https://v3.vuejs.org/guide/composition-api-introduction.html#why-composition-api
This is pretty well explained into the official guide of the migration to Vue3: https://v3.vuejs.org/guide/composition-api-introduction.html#why-composition-api
What you do call "Vue2 syntax" is actually Options API.
While the Composition API ("Vue3 syntax") is mainly for:
One thing to remember is that you can totally use Options API while using Vue3, it's retro-compatible and totally fine. You can even mix both in the same file too!