Skip to content

Commit c735553

Browse files
authored
add codestyle to some words
1 parent 8573bd5 commit c735553

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/guide/typescript/options-api.md

Lines changed: 3 additions & 3 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

@@ -30,7 +30,7 @@ export default defineComponent({
3030
})
3131
```
3232

33-
However, the runtime props options only support using constructor functions as a prop's type - there is no way to specify complex types such as objects with nested properties or function call signatures.
33+
However, the runtime `props` options only support using constructor functions as a prop's type - there is no way to specify complex types such as objects with nested properties or function call signatures.
3434

3535
To annotate complex props types, we can use the `PropType` utility type:
3636

@@ -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)