コンテンツへスキップ

tryOnBeforeUnmount

カテゴリ
エクスポートサイズ
93 B
最終変更日
先週

安全な`onBeforeUnmount`。コンポーネントのライフサイクル内にある場合は`onBeforeUnmount()`を呼び出し、そうでない場合は何も行いません。

使用方法

js
import { tryOnBeforeUnmount } from '@vueuse/core'

tryOnBeforeUnmount(() => {

})

型定義

typescript
/**
 * Call onBeforeUnmount() if it's inside a component lifecycle, if not, do nothing
 *
 * @param fn
 * @param target
 */
export declare function tryOnBeforeUnmount(fn: Fn, target?: any): void

ソースコード

ソースコードドキュメント

コントリビューター

Anthony Fu
Ngheizit
Doctorwu
qiang

変更ログ

v12.0.0-beta.1 2024/11/21
0a9ed - feat!: Vue 2サポートの削除、バンドルの最適化、クリーンアップ (#4349)
v10.7.1 2023/12/27
ce420 - fix: Vue2における`tryOnMounted`の修正 (#3658)
v10.7.0 2023/12/5
f2aeb - feat(tryOnMounted): target引数のサポート (#3185)

MITライセンスの下でリリースされています。