Skip to content

Commit

Permalink
docs: missed return value type for useModel() (#3005)
Browse files Browse the repository at this point in the history
  • Loading branch information
altrusl authored Sep 16, 2024
1 parent f3b6dcf commit e20eb77
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/api/composition-api-helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,17 @@ This is the underlying helper that powers [`defineModel()`](/api/sfc-script-setu
props: Record<string, any>,
key: string,
options?: DefineModelOptions
)
): ModelRef
type DefineModelOptions<T = any> = {
get?: (v: T) => any
set?: (v: T) => any
}
type ModelRef<T, M extends PropertyKey = string, G = T, S = T> = Ref<G, S> & [
ModelRef<T, M, G, S>,
Record<M, true | undefined>
]
```

- **Example**
Expand Down

0 comments on commit e20eb77

Please sign in to comment.