Skip to content

Commit fe15ed8

Browse files
authored
docs: onBeforeUnmount to onUnmounted for consistency (#2413)
1 parent 8c2e852 commit fe15ed8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/guide/reusability/composables.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ For example, we can extract the logic of adding and removing a DOM event listene
9494

9595
```js
9696
// event.js
97-
import { onMounted, onBeforeUnmount } from 'vue'
97+
import { onMounted, onUnmounted } from 'vue'
9898

9999
export function useEventListener(target, event, callback) {
100100
// if you want, you can also make this
101101
// support selector strings as target
102102
onMounted(() => target.addEventListener(event, callback))
103-
onBeforeUnmount(() => target.removeEventListener(event, callback))
103+
onUnmounted(() => target.removeEventListener(event, callback))
104104
}
105105
```
106106

0 commit comments

Comments
 (0)