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

Global component intellisense in template #228

Closed
ci010 opened this issue May 31, 2021 · 1 comment
Closed

Global component intellisense in template #228

ci010 opened this issue May 31, 2021 · 1 comment
Labels

Comments

@ci010
Copy link

ci010 commented May 31, 2021

Follow the instruction, I added the definition of a global component

import { Component } from 'vue'

interface MyPropTypes { 
  /**
   * document content
   */
  p: string
}

declare module 'vue' {
  export interface GlobalComponents {
    componentName: Component<MyPropTypes>
  }
}

export { }

In the vue template, it cannot have correct intellisense hint for this component,
but if I change it to DefineComponent

import { DefineComponent } from 'vue'

declare module 'vue' {
  export interface GlobalComponents {
    componentName: DefineComponent<MyPropTypes>
  }
}

export { }

it works, whereas the code navigation is wrong.

<template>
   <my-component :p="xxx" />
</template>

Go to definition not work for p (it works if I use Component), and it cannot show the document of it.

@johnsoncodehk
Copy link
Member

Please wait for vuejs/core#3656.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants