主题
useMounted
参考文献中的安装状态。
¥Mounted state in ref.
示例
unmounted
用法
¥Usage
js
import { useMounted } from '@vueuse/core'
const isMounted = useMounted()
这本质上是以下内容的简写:
¥Which is essentially a shorthand of:
ts
const isMounted = ref(false)
onMounted(() => {
isMounted.value = true
})
类型声明
typescript
/**
* Mounted state in ref.
*
* @see https://vueuse.org/useMounted
*/
export declare function useMounted(): Ref<boolean, boolean>