Export type `DefineComponent`

This issue has been created since 2022-08-16.

What problem does this feature solve?

Most Vue 2 third-party libraries do not provide types for components. Therefore, they cannot profit type checking and intellisense provided by Volar. It may be good to export type DefineComponent just like in Vue 3, so that users can manually shim component types or create PR to add TypeScript support for those Vue2 libraries without changing source code written in Vue <= 2.6.

What does the proposed API look like?

To manually define type of a component in Vue 2.7, we can:

import type { DefineComponent, VNode } from 'vue'

declare module '@vue/runtime-dom' {
  export interface GlobalComponents {
    MyComponent: DefineComponent<
      Props,
      {
        $scopedSlots: {
          slotName: ({args: {propName: propType}}) => VNode[]
        }
      },
      {},
      {},
      Methods
    >
  }
}
More Details About Repo
Owner Name vuejs
Repo Name vue
Full Name vuejs/vue
Language TypeScript
Created Date 2013-07-29
Updated Date 2022-10-07
Star Count 199821
Watcher Count 6092
Fork Count 32893
Issue Count 587

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
FS.getTypePath is not a function 1 2021-04-19 2022-09-29
Aperio AppMag inconsistent representation. 0 2021-05-29 2022-09-06
Uncaught (in promise) DOMException 8 2019-08-12 2022-07-15
Finetune pretrained models on different dataset 5 2021-09-13 2022-07-14
Discussion: throwing an error if the image is not the right size 0 2021-08-28 2022-08-13
create users and admin users 2 2021-11-17 2022-07-15
Calling rxd.set_solve_type has no effect after finitialize 0 2022-03-21 2022-07-23
Checar se o comando `psql` está disponível antes de iniciar processamento 6 2022-01-26 2022-09-27
ActionNotSupported-The message with Action 'sendBill' 7 2022-07-01 2022-07-16
Sometimes a fader goes crazy, after hours working 2 2021-11-23 2022-08-22
Failed to wipeDai or wipeAll dai to pay off debet 1 2021-02-21 2022-09-27
Add latest tag on weekly releases 2 2021-12-13 2022-09-30
Build issue on a react native app using turborepo 4 2022-01-15 2022-09-25
[Bug Report]select下拉框无匹配值时,会自动删除v-model中相应的值 0 2021-07-15 2022-09-28
Cannot show a button in Left / Right bar if a width is not specified 1 2021-04-26 2022-09-15
给tabbleview的headerview设置视频自动播放,点击全屏无响应 2 2021-11-30 2022-09-19
Mopidy-Iris: Size of Albumcover in ...:6680/iris/album/xyz 3 2022-06-10 2022-08-22
Sigspace unspace space --> Cannot find method 'rxtype' on object of type NQPMu 0 2021-09-17 2022-08-22
RawResponse field in Response should be unexported 1 2020-12-13 2022-08-19
Clearify install dependencies 3 2019-10-11 2021-12-29
Sound not working 1 2021-09-24 2022-01-14
Web developers cant get phonetic runs that are sent from some East Asian IMEs 2 2021-10-25 2022-09-10
Support <rp> tag 0 2021-10-25 2021-12-22
Slice mesh with 2d polygon 3 2022-04-15 2022-07-13
Error When Using RANSAC_SD 11 2022-04-21 2022-08-03
cannot reverse migration command: drop/create constraint 1 2021-02-03 2022-04-26
模型不收敛预测不成功 8 2020-04-11 2022-01-14
[Config Menu] Extend templates default hidden - not able to enable 3 2022-02-21 2022-10-01
Pindahkan tombol login ke sebelah paling kanan. 0 2021-07-13 2022-07-01
Deployment Strapi v4 with MySQL DB 6 2022-01-05 2022-08-10
hhvm 4.97 issue: x\node should permit ?XHPChild children 2 2021-02-17 2022-09-23
Use of XHP at Facebook 2 2021-05-10 2022-09-23
[Bug] FTP additional account - error in path 0 2022-06-19 2022-07-31
Runtime migration guide 0 2022-08-08 2022-10-05
Fix the .geo_unrolled file to include a warning and add 'SetFactory' method 0 2022-09-20 2022-09-19
Devices cannot be add by Serial Number 5 2022-04-20 2022-09-22
GUI: add card icon for equipment/attachment 0 2021-10-29 2022-07-27
Failed to export slashing protection data. 1 2021-09-17 2022-10-05
after upgrade erigon to v2022.03.02, erigon start fail with error: "cannot downgrade major DB version from 5 to 3" 2 2022-03-31 2022-09-15
Game crashing when going into video settings on 1.19.2 2 2022-08-21 2022-09-07
Feature request: Implement scale_type "original" / scale_type "passX" for shader presets 0 2022-09-25 2022-10-07
When zlib is not available, trying to take a screenshot will throw an error 7 2022-09-16 2022-10-07
apollo-client transforms response 1 2022-02-08 2022-10-06
SSR模式下引入antd 没有交互 1 2021-06-10 2022-01-19
collect2.exe: error: ld returned 1 exit status 8 2018-09-05 2022-09-14
Point CI bot to a new Slack channel 2 2022-03-11 2022-07-01
🐛 Bug Report: Login Fails with older SDK 1 2022-07-06 2022-09-26
When GCB Build fails, skaffold doesn't cancel in process jobs 0 2022-05-11 2022-09-08
quoteParty.partySubIdOrTypeId column should not have FK constraint to partyIdentifierType table 4 2021-09-20 2022-09-11
[Enhancement]: On clicking the `view enrolled agent` button no agents are filtered under Agents tab. 5 2022-04-13 2022-05-27