Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement composition-api-lifecycle type #3159

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/api/composition-api-lifecycle.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Registers a callback to be called after the component has been mounted.
- **Type**

```ts
function onMounted(callback: () => void): void
function onMounted(callback: () => void, target?: ComponentInternalInstance | null): void
```

- **Details**
Expand Down Expand Up @@ -53,7 +53,7 @@ Registers a callback to be called after the component has updated its DOM tree d
- **Type**

```ts
function onUpdated(callback: () => void): void
function onUpdated(callback: () => void, target?: ComponentInternalInstance | null): void
```

- **Details**
Expand Down Expand Up @@ -96,7 +96,7 @@ Registers a callback to be called after the component has been unmounted.
- **Type**

```ts
function onUnmounted(callback: () => void): void
function onUnmounted(callback: () => void, target?: ComponentInternalInstance | null): void
```

- **Details**
Expand Down Expand Up @@ -135,7 +135,7 @@ Registers a hook to be called right before the component is to be mounted.
- **Type**

```ts
function onBeforeMount(callback: () => void): void
function onBeforeMount(callback: () => void, target?: ComponentInternalInstance | null): void
```

- **Details**
Expand All @@ -151,7 +151,7 @@ Registers a hook to be called right before the component is about to update its
- **Type**

```ts
function onBeforeUpdate(callback: () => void): void
function onBeforeUpdate(callback: () => void, target?: ComponentInternalInstance | null): void
```

- **Details**
Expand All @@ -167,7 +167,7 @@ Registers a hook to be called right before a component instance is to be unmount
- **Type**

```ts
function onBeforeUnmount(callback: () => void): void
function onBeforeUnmount(callback: () => void, target?: ComponentInternalInstance | null): void
```

- **Details**
Expand Down Expand Up @@ -282,7 +282,7 @@ Registers a callback to be called after the component instance is inserted into
- **Type**

```ts
function onActivated(callback: () => void): void
function onActivated(callback: () => void, target?: ComponentInternalInstance | null): void
```

- **See also** [Guide - Lifecycle of Cached Instance](/guide/built-ins/keep-alive#lifecycle-of-cached-instance)
Expand All @@ -296,7 +296,7 @@ Registers a callback to be called after the component instance is removed from t
- **Type**

```ts
function onDeactivated(callback: () => void): void
function onDeactivated(callback: () => void, target?: ComponentInternalInstance | null): void
```

- **See also** [Guide - Lifecycle of Cached Instance](/guide/built-ins/keep-alive#lifecycle-of-cached-instance)
Expand Down