Skip to content

Commit

Permalink
feat: 🔥 增强组件类型
Browse files Browse the repository at this point in the history
  • Loading branch information
agileago committed Aug 10, 2022
1 parent 4e631d1 commit 0544000
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion example/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class App extends VueComponent {
return (
<Menu.SubMenu title={r.meta?.title} key={r.path}>
{'children' in r &&
r.children.map((i) => {
r.children?.map((i) => {
return (
<Menu.Item key={i.path}>
<RouterLink
Expand Down
13 changes: 11 additions & 2 deletions src/type.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
import type { Prop, SetupContext, StyleValue, VNodeChild } from 'vue'
import type {
ComponentCustomProps,
Prop,
SetupContext,
StyleValue,
VNodeChild,
VNodeProps,
} from 'vue'

/**
* 装饰器处理
Expand Down Expand Up @@ -82,4 +89,6 @@ type DistributiveVSlots<T> = T extends T ? WithVSlots<T> : never
export type VueComponentProps<T extends {}> = DistributiveOmit<T, 'slots'> &
DistributiveVModel<T> &
DistributiveVSlots<T> &
AllowedComponentProps
VNodeProps &
AllowedComponentProps &
ComponentCustomProps

0 comments on commit 0544000

Please sign in to comment.