bug: Vue IonTabBar and IonButtons missing slot prop type

未關閉
#30,545 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
半天
新手友好度
48/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
typescript
領域
frontend

研究方向

從 IonTabBar 和 IonButtons 的 Vue 元件型別定義開始,使用連結的 StackBlitz 專案重現 strictTemplates 錯誤。檢查 slot 屬性在元件定義中如何表示,然後驗證在兩個元件中使用具名 slot 時,在啟用 strictTemplates 的 vue-tsc 下都能通過型別檢查。

由索引模型根據 Issue 內容生成。

描述

package: vue type: bug
Prerequisites
Ionic Framework Version

v8.x

Current Behavior

In a Vue application with a strict templates vue-tsc preset (that disallows undefined properties to be set), using the IonTabBar or IonButtons with a named slot (for example slot="bottom") leads to a TypeScript error.

This is due to the fact that vue-tsc doesn't recognise a slot prop.
There may be more components with the same issue.

Expected Behavior

I expect the component definition to include the slot property.

Steps to Reproduce

In a vue project with vue-tsc's configuration set like so (part of tsconfig.json)

"vueCompilerOptions": {
	"strictTemplates": true
}

Add this to any vue component's template:

<IonTabBar slot="bottom">
	<IonTabButton
		tab="tab-home"
		href="/tabs/tab-home"
	>
		<p>Home</p>
	</IonTabButton>
</IonTabBar>
Code Reproduction URL

https://stackblitz.com/edit/vue-kq5gzqta?file=package.json,src%2Fcomponents%2FHelloWorld.vue,tsconfig.json

Ionic Info

Ionic:

Ionic CLI : 7.2.0
Ionic Framework : @ionic/vue 8.6.2

Capacitor:

Capacitor CLI : not installed
@capacitor/android : 7.4.0
@capacitor/core : 7.4.0
@capacitor/ios : 7.4.0

Utility:

cordova-res : not installed globally
native-run : 2.0.1

System:

NodeJS : v20.17.0
npm : 11.0.0
OS : macOS Unknown

Additional Information

No response

主要語言
TypeScript
星號
52.8k
分支
13.3k
平均合併
3 天 1 小時
30 天內合併 PR
86

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

ionic-team/ionic-framework 的其他 Issue

查看 ionic-team/ionic-framework 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。