Skip to content

Commit

Permalink
fix(template): 新增类型导出适配 vue 开发插件
Browse files Browse the repository at this point in the history
  • Loading branch information
ZakaryCode committed Dec 30, 2022
1 parent 6291beb commit f762805
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/taro-cli/templates/default/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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']
*/
}
}<%}-%>

0 comments on commit f762805

Please sign in to comment.