4 ms·
<script setup> is going to bring Vue closer to Svelte and solve the problems of long list of refs returned and .value's everywhere. When I checked an early draf
by oefrha 5y ago
<script setup> is going to bring Vue closer to Svelte and solve the problems of long list of refs returned and .value's everywhere. When I checked an early draft last year I recall some limitations due to lack or inadequate support for non-setup component options, but from skimming https://v3.vuejs.org/api/sfc-script-setup.html https://v3.vuejs.org/api/sfc-script-setup.html I got the impression that most of the limitations have been ironed out. Really excited to try this out.
Edit: Actually it seems that a solution to .value's everywhere has been postponed and is currently discussed in https://github.com/vuejs/rfcs/discussions/369 https://github.com/vuejs/rfcs/discussions/369. The current iteration still requires unwrapping inside the script tag. The docs doesn't seem to make this clear since the examples are too simple...
- ducharmdev 5y ago<script setup> looks awesome, makes components using the composition API look way more approachable IMO. I did a side project in svelte and really enjoyed the component layout, and have missed that when working in other frameworks.