From f76280511811bf5a9ffa2f80bce2171be6e5d263 Mon Sep 17 00:00:00 2001 From: Zakary Date: Wed, 28 Dec 2022 16:58:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(template):=20=E6=96=B0=E5=A2=9E=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=AF=BC=E5=87=BA=E9=80=82=E9=85=8D=20vue=20=E5=BC=80?= =?UTF-8?q?=E5=8F=91=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/taro-cli/templates/default/types/global.d.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/taro-cli/templates/default/types/global.d.ts b/packages/taro-cli/templates/default/types/global.d.ts index 09caeb880cdf..befec0fdc198 100644 --- a/packages/taro-cli/templates/default/types/global.d.ts +++ b/packages/taro-cli/templates/default/types/global.d.ts @@ -20,4 +20,12 @@ declare namespace NodeJS { <%if (['vue', 'vue3'].includes(framework)) {-%> declare module '@tarojs/components' { export * from '@tarojs/components/types/index.vue3' +} +declare module '@vue/runtime-core' { + export interface GlobalComponents extends JSX.IntrinsicElements { + /** Note: Vue 在 runtime 中将 JSX.IntrinsicElements 通过 index signature 重复声明标签 + * 这会导致插件无法正常跳转类型,可以手动覆盖声明标签活得更好的体验,参考如下: + * 'scroll-view': JSX.IntrinsicElements['scroll-view'] + */ + } }<%}-%>