From 08f7f0e18ae6264a5b6f13810c7d4f1eb403c56d Mon Sep 17 00:00:00 2001 From: jaywcjlove <398188662@qq.com> Date: Mon, 21 Nov 2022 22:06:45 +0800 Subject: [PATCH] doc: update vue.md #10 --- docs/vue.md | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/docs/vue.md b/docs/vue.md index ac54e7f..79d73db 100644 --- a/docs/vue.md +++ b/docs/vue.md @@ -298,7 +298,7 @@ import { defineComponent, reactive } from 'vue'; // `defineComponent`用于IDE推导类型 export default defineComponent({ - // `setup` 是一个专门用于组合式 API 的特殊钩子函数 + // setup 用于组合式 API 的特殊钩子函数 setup() { const state = reactive({ count: 0 }); @@ -309,6 +309,7 @@ export default defineComponent({ }, }); ``` + ### 声明方法 @@ -339,6 +340,7 @@ export default defineComponent({ }, }) ``` + ### ` @@ -631,13 +636,15 @@ const onSearch = function(){ ### Provide / Inject ```ts -// types import type { InjectionKey, Ref } from 'vue' export const ProvideKey = Symbol() as InjectionKey> ``` + -```ts +在应用中使用 `ProvideKey` + +```html