Naming a component's export something else than _default when using setup #7555
Unanswered
Csardelacal
asked this question in
Help/Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey there,
I'm running into an issue that I can't, for the life of me and Google, figure out without any help. And it seems so trivial that I can't help but think it has to be a thing.
<script setup lang="ts">
When I run
./node_modules/vue-tsc/bin/vue-tsc.js --declaration --emitDeclarationOnly
I get a.d.ts
file for my component that looks like this:When I'm referencing the component's interface VSCode will autocomplete the import for me whenever I start typing it's name. Sadly, since the component itself seems to always be called
_default
, there's no way to distinguish between the components, which forces me to type out the entire path every time.I've seen that, when using options mode, I could just use
export const MyComponent = defineComponent({...})
andexport default MyComponent
and get a component with a custom name and it being used as default.So, my question: Is there any way (when in
setup
mode) to influence the name of the resulting component?Beta Was this translation helpful? Give feedback.
All reactions