Skip to content

Commit ee2977b

Browse files
authored
fix(useMounted): compatible with vue2.7 (#3802)
1 parent 0600c90 commit ee2977b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/useMounted/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// eslint-disable-next-line no-restricted-imports
2-
import { getCurrentInstance, onMounted, ref } from 'vue-demi'
2+
import { getCurrentInstance, isVue2, onMounted, ref } from 'vue-demi'
33

44
/**
55
* Mounted state in ref.
@@ -13,7 +13,7 @@ export function useMounted() {
1313
if (instance) {
1414
onMounted(() => {
1515
isMounted.value = true
16-
}, instance)
16+
}, isVue2 ? null : instance)
1717
}
1818

1919
return isMounted

0 commit comments

Comments
 (0)