core icon indicating copy to clipboard operation
core copied to clipboard

fix(types): Register built-in components Teleport and Suspense should work

Open yuwu9145 opened this issue 4 years ago • 6 comments

fix #5833 & #4950 (built-in components like Teleport do not work)

Cause is image

which results in Teleport & Suspense are not legitimate Component type.

However, as per office doc (usage with built-in components for rendering dynamic components), <component :is="isGroup ? 'Teleport' : 'Suspense'"> ... </component> will require to register built-in components

yuwu9145 avatar Nov 17 '21 06:11 yuwu9145

Thanks but this wouldn't work for library custom components like RouterView or RouterLink in vue router. It would also be great to add a d-ts test to check for externally added components

posva avatar Nov 17 '21 09:11 posva

This issue actually has nothing to do with $props, and as per my testing, both RouterView & RouterLink work, as they serve as legitimate Component type. The reason why Teleport breaks type Inference is because it has __isTeleport property which does not exist in Component, same to Suspense.

Edit: RouterView works in my place image

I will add tests soon

yuwu9145 avatar Nov 17 '21 11:11 yuwu9145

d-ts test has been added, without changes in this pull request, it will fail

yuwu9145 avatar Nov 17 '21 21:11 yuwu9145

Deploy Preview for vue-sfc-playground ready!

Name Link
Latest commit f9fc790952e37b027d45c954231d1675720f9ded
Latest deploy log https://app.netlify.com/sites/vue-sfc-playground/deploys/626bda943a44460009c56288
Deploy Preview https://deploy-preview-4955--vue-sfc-playground.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Apr 29 '22 12:04 netlify[bot]

Deploy Preview for vuejs-coverage ready!

Name Link
Latest commit f9fc790952e37b027d45c954231d1675720f9ded
Latest deploy log https://app.netlify.com/sites/vuejs-coverage/deploys/626bda941c79ad00082920e7
Deploy Preview https://deploy-preview-4955--vuejs-coverage.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Apr 29 '22 12:04 netlify[bot]

Deploy Preview for vue-next-template-explorer ready!

Name Link
Latest commit f9fc790952e37b027d45c954231d1675720f9ded
Latest deploy log https://app.netlify.com/sites/vue-next-template-explorer/deploys/626bda94c00a94000955aeae
Deploy Preview https://deploy-preview-4955--vue-next-template-explorer.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Apr 29 '22 12:04 netlify[bot]

Could you please resolve the conflicts?

edison1105 avatar Oct 29 '24 07:10 edison1105