Skip to content

Commit 4f20c17

Browse files
authored
Update options-api.md
1 parent c735553 commit 4f20c17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/guide/typescript/options-api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
While Vue does support TypeScript usage with Options API, it is recommended to use Vue with TypeScript via Composition API as it offers simpler, more efficient and more robust type inference.
77
:::
88

9-
## Typing Component `props`
9+
## Typing Component Props
1010

1111
Type inference for props in Options API requires wrapping the component with `defineComponent()`. With it, Vue is able to infer the types for the props based on the `props` option, taking additional options such as `required: true` and `default` into account:
1212

@@ -92,7 +92,7 @@ export default defineComponent({
9292

9393
This prevents TypeScript from having to infer the type of `this` inside these functions, which, unfortunately, can cause the type inference to fail.
9494

95-
## Typing Component `emits`
95+
## Typing Component Emits
9696

9797
We can declare the expected payload type for an emitted event using the object syntax of the `emits` option. Also, all non-declared emitted events will throw a type error when called:
9898

0 commit comments

Comments
 (0)