Skip to content

Commit 9d4abd2

Browse files
committed
wrapping up advanced
1 parent 281a75c commit 9d4abd2

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/guide/typescript/advanced.md

+4-11
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,14 @@ If you check the [defineComponent source-code](https://github.com/vuejs/core/blo
127127

128128
#### Generics parameters
129129

130-
`DefineComponent` generic order is pretty stable, but it's not guaranteed to be the same in future versions, so it's recommended to use [DeclareComponent](./../../api/utility-types.html#declarecomponent) instead.
131-
132-
```ts
133-
134-
130+
`DefineComponent` generic order is pretty stable, but it's not guaranteed to be the same in future versions, the reason is because it needs to support the full Vue behavior (eg: Mixins/Extends), so it's recommended to use the more stable helper [DeclareComponent](./../../api/utility-types.html#declarecomponent) instead.
135131

136132
### DefineComponent
137133

138-
Returned from [defineComponent](./../../api/general.html#definecomponent),
139-
```
140-
134+
Returned from [defineComponent](./../../api/general.html#definecomponent), has [Options](#options), [Render](#render) and [Instance](#instance) information about the component.
141135

142136
### Bespoke `defineComponent`
143137

144-
Vue options are very hard to get the type hard, sometimes `defineComponent` is not enough and creating a bespoke `defineComponent` can be useful for some more advance cases, such as [@vue/test-utils](https://test-utils.vuejs.org/) [mount](https://test-utils.vuejs.org/api/#mount) method.
145-
138+
Vue options are very hard to get the correct type, sometimes `defineComponent` is not enough and creating a bespoke `defineComponent` can be useful for some more advance cases, such as [@vue/test-utils](https://test-utils.vuejs.org/) [mount](https://test-utils.vuejs.org/api/#mount) method.
146139

147-
http://localhost:5173/api/utility-types.html#definecomponentoptions
140+
For that use case we recommend using the utilities [DefineComponentOptions & DefineComponentFromOptions](../../api//utility-types.md#definecomponentoptions).

0 commit comments

Comments
 (0)