Skip to content

Commit

Permalink
fix: reset head in onBeforeUnmount instead
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Jan 18, 2021
1 parent 892c267 commit 87efe1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
@@ -1,4 +1,4 @@
import { App, inject, onUnmounted, watchEffect } from 'vue'
import { App, inject, onBeforeUnmount, watchEffect } from 'vue'
import { PROVIDE_KEY, HEAD_COUNT_KEY, HEAD_ATTRS_KEY } from './constants'
import { createElement } from './create-element'
import { stringifyAttrs } from './stringify-attrs'
Expand Down Expand Up @@ -237,7 +237,7 @@ export const useHead = (fn: () => HeadObj) => {
head.updateDOM()
})

onUnmounted(() => {
onBeforeUnmount(() => {
if (tags) {
head.removeHeadTags(tags)
head.updateDOM()
Expand Down

0 comments on commit 87efe1a

Please sign in to comment.