You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I saw some people on Twitter that noted Vue's general usage of default exports for all components. Some people, and myself to an extent, think that named exports are a better practice, but I love <script setup> too much to give it up for named exports.
So I was thinking about enhancing <script setup> with an additional attribute: name. We can use it to specify the name it'll be exported as, as well as potentially the component's name (so it doesn't need to be computed based on the file name) for recursive use of the component.
E.g.
<scriptsetupname="MyComponent"></script>
Would compile to
exportconstMyComponent={name: "MyComponent"// I'm not 100% set on this part}
I'm not sure how you would handle someone using a separate script tag to add inheritAttrs or anything, but I bet you can make it work.
The text was updated successfully, but these errors were encountered:
This is not a duplicate entirely. That issue was for component name and I'm asking for the ability to name the export rather than using a default export.
I saw some people on Twitter that noted Vue's general usage of default exports for all components. Some people, and myself to an extent, think that named exports are a better practice, but I love
<script setup>
too much to give it up for named exports.So I was thinking about enhancing
<script setup>
with an additional attribute:name
. We can use it to specify the name it'll be exported as, as well as potentially the component's name (so it doesn't need to be computed based on the file name) for recursive use of the component.E.g.
Would compile to
I'm not sure how you would handle someone using a separate
script
tag to addinheritAttrs
or anything, but I bet you can make it work.The text was updated successfully, but these errors were encountered: