Skip to content

Commit 0544000

Browse files
committed
feat: 🔥 增强组件类型
1 parent 4e631d1 commit 0544000

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

example/main.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class App extends VueComponent {
6767
return (
6868
<Menu.SubMenu title={r.meta?.title} key={r.path}>
6969
{'children' in r &&
70-
r.children.map((i) => {
70+
r.children?.map((i) => {
7171
return (
7272
<Menu.Item key={i.path}>
7373
<RouterLink

src/type.ts

+11-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import type { Prop, SetupContext, StyleValue, VNodeChild } from 'vue'
1+
import type {
2+
ComponentCustomProps,
3+
Prop,
4+
SetupContext,
5+
StyleValue,
6+
VNodeChild,
7+
VNodeProps,
8+
} from 'vue'
29

310
/**
411
* 装饰器处理
@@ -82,4 +89,6 @@ type DistributiveVSlots<T> = T extends T ? WithVSlots<T> : never
8289
export type VueComponentProps<T extends {}> = DistributiveOmit<T, 'slots'> &
8390
DistributiveVModel<T> &
8491
DistributiveVSlots<T> &
85-
AllowedComponentProps
92+
VNodeProps &
93+
AllowedComponentProps &
94+
ComponentCustomProps

0 commit comments

Comments
 (0)