Skip to content
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

fix(compiler-sfc): genSetupPropsType #6179

Closed
wants to merge 1 commit into from
Closed

Conversation

billypon
Copy link

// Child.vue
<template>
  <div>Hello, {{ props.name }}</div>
</template>

<script lang="ts">
export interface ChildProps {
  name: string
}
</script>

<script lang="ts" setup>
const props = defineProps<ChildProps>()
</script>
// Parent.vue
import Child from './Child.vue'
import type { ChildProps } from './Child.vue'

Will cause error:

Unexpected ")"
12 |    expose();
13 |  
14 |  const props = __props as ildProps>()
   |                                     ^
15 |  
16 |  

Because ChildProps is defined by <script>, not <script setup>

@edison1105
Copy link
Member

edison1105 commented Jun 25, 2022

thanks for your PR, but there is another PR cover this case see #5831

@billypon
Copy link
Author

OK, I close my PR, and wait for another PR.

@billypon billypon closed this Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants