Skip to content

Commit

Permalink
fix(useMounted): compatible with vue2.7 (#3802)
Browse files Browse the repository at this point in the history
  • Loading branch information
yanbowe authored Feb 21, 2024
1 parent 0600c90 commit ee2977b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/useMounted/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// eslint-disable-next-line no-restricted-imports
import { getCurrentInstance, onMounted, ref } from 'vue-demi'
import { getCurrentInstance, isVue2, onMounted, ref } from 'vue-demi'

/**
* Mounted state in ref.
Expand All @@ -13,7 +13,7 @@ export function useMounted() {
if (instance) {
onMounted(() => {
isMounted.value = true
}, instance)
}, isVue2 ? null : instance)
}

return isMounted
Expand Down

0 comments on commit ee2977b

Please sign in to comment.