Skip to content

[RFC436] interface delcared in setup function should be elevated to top scope instead of function scope #1966

Closed
@HerringtonDarkholme

Description

@HerringtonDarkholme

Input file:

<script setup lang="ts" generic="T extends Test">
interface Test {
  test: string
}
const props = defineProps<{ 
  msg: T,    // no works
  mmm: Test, // works
}>()
console.log(props.msg.test)
</script>

Compiled virtual file

image

Note the interface should be compiled outside of render function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions