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

A local component cannot override a global component #1886

Closed
f3oall opened this issue Sep 19, 2022 · 2 comments · Fixed by #3333
Closed

A local component cannot override a global component #1886

f3oall opened this issue Sep 19, 2022 · 2 comments · Fixed by #3333
Labels
bug Something isn't working

Comments

@f3oall
Copy link

f3oall commented Sep 19, 2022

Initial issue: nuxt/framework#7401

It seems like Volar can't correctly find a type of Functional Component when it is used inside the template.

image

Environment:
VSCode + Volar + TakeOver mode 4.8.2

@xiaoxiangmoe xiaoxiangmoe added the bug Something isn't working label Sep 20, 2022
@xiaoxiangmoe xiaoxiangmoe changed the title Functional Component has type 'any' A local component cannot override a global component Sep 20, 2022
@xiaoxiangmoe
Copy link
Collaborator

xiaoxiangmoe commented Sep 20, 2022

// components.d.ts
declare module 'vue' {
    export interface GlobalComponents {
        FunctionalComponent: any;
    }
}

export {}
<!-- App.vue -->
<script lang="ts">
declare const FunctionalComponent: new () => {
  $props: {
    foo: string
  }
}
</script>
<script setup lang="ts"></script>
<template>
  <FunctionalComponent />
</template>

image


This is a bug of volar local component registry.

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Dec 3, 2022

Revert in 2fb26d4, because it leads to #2157.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants