diff --git a/docs/vue.md b/docs/vue.md index 81888700..cb62751e 100644 --- a/docs/vue.md +++ b/docs/vue.md @@ -616,6 +616,46 @@ const onSearch = function(){ 父组件调用子组件的方法 +### Provide / Inject + +```ts +// types +import type { InjectionKey, Ref } from 'vue' + +export const ProvideKey = Symbol() as InjectionKey> +``` + +```ts + + + +``` + +父组件为后代组件提供数据 + +```ts + + + +``` + +后代组件注入父组件提供的数据 + API 参考