Skip to content

component type error #1996

Closed
Closed
@HodgeWen

Description

@HodgeWen

BUG report

When <script lang="ts" setup> and normal <script lang="ts"> are used together. it's report:
Type '{}' is not assignable to type 'ComponentProps<() => ComponentPublicInstanceConstructor<{ $: ComponentInternalInstance; $data: {}; $props: Partial<{}> & Omit<Readonly<ExtractPropTypes<{}>> & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>; ... 10 more ...; $watch(source: string | Function, cb: Function, options?: WatchOptions<......'.

<!-- ComponentWithMultipleRoots -->
<template>
  <div></div>
  <div></div>
</template>

<script lang="ts" setup>
//...
</script>

<script lang="ts">
export default {
   inheritAttrs: false
}
</script>
<template>
  <ComponentWithMultipleRoots />
</template>

image

ENV

Typescript version: 4.8.4
vite version: 3.1.7
volar version: 1.0.5
vscode version: 1.72
os: 5.17.15-1-MANJARO(x64)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions