Skip to content

Export named default, not working in template #2106

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

Closed
jorisvergeer opened this issue Nov 10, 2022 · 1 comment
Closed

Export named default, not working in template #2106

jorisvergeer opened this issue Nov 10, 2022 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@jorisvergeer
Copy link

I'd like to write components like this:

<template>
  <Modal> ... </Modal>
</template>
<script lang="ts">

const MyModal = defineComponent({ ... })

export default MyModal ;

export function showMyModal()
{
  ... //code that uses MyModal 
}

</script>

The problem with this is that because i don't use export default defineComponent({ ... }) directly, then i don't get the typing checks in the template part.

Shouldn't volar be able to infer the correct defineComponent, even though in this case it is indirectly exported?

@johnsoncodehk
Copy link
Member

Duplicate of #80

@johnsoncodehk johnsoncodehk marked this as a duplicate of #80 Nov 29, 2022
@johnsoncodehk johnsoncodehk added the duplicate This issue or pull request already exists label Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants