From f870ccec8249d255a57f1b51dafaff78f4652a1a Mon Sep 17 00:00:00 2001 From: Michael Liou <35322700+lioumens@users.noreply.github.com> Date: Mon, 19 Jun 2023 07:54:27 -0500 Subject: [PATCH] onBeforeUnmount to onUnmounted for consistency --- src/guide/reusability/composables.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/guide/reusability/composables.md b/src/guide/reusability/composables.md index 563acbaef4..5a574129b6 100644 --- a/src/guide/reusability/composables.md +++ b/src/guide/reusability/composables.md @@ -94,13 +94,13 @@ For example, we can extract the logic of adding and removing a DOM event listene ```js // event.js -import { onMounted, onBeforeUnmount } from 'vue' +import { onMounted, onUnmounted } from 'vue' export function useEventListener(target, event, callback) { // if you want, you can also make this // support selector strings as target onMounted(() => target.addEventListener(event, callback)) - onBeforeUnmount(() => target.removeEventListener(event, callback)) + onUnmounted(() => target.removeEventListener(event, callback)) } ```