定义接口IEvents问题
来源:3-19 Vue3.3更新简介

慕运维4335526
2024-11-07
Type ‘IEvents’ does not satisfy the constraint ‘ComponentTypeEmits’.
Type ‘IEvents’ is not assignable to type ‘Record<string, any[]>’.ts(2344)
Type ‘IEvents’ does not satisfy the constraint ‘ComponentTypeEmits’.
Type ‘IEvents’ is not assignable to type ‘Record<string, any[]>’.
Index signature for type ‘string’ is missing in type ‘IEvents’.
为什么定义的IEvents接口用下面change: [hidden: boolean]就会报上面的错,然后用[change: string]: [hidden: boolean]就正常。
vue版本已经是3.5.12
写回答
1回答
-
张轩
2024-11-08
同学你好
请提供一下你的源代码,我在本地帮你看一下
00
相似问题