Skip to content

useSupported

SSR 兼容性 isSupported

¥SSR compatibility isSupported

用法

¥Usage

ts
import { useSupported } from '@vueuse/core'

const isSupported = useSupported(() => navigator && 'getBattery' in navigator)

if (isSupported.value) {
  // do something
  navigator.getBattery
}

类型声明

typescript
export declare function useSupported(
  callback: () => unknown,
): ComputedRef<boolean>

源代码

源代码文档

变更日志

No recent changes

VueUse 中文网 - 粤ICP备13048890号