On this page
useSupported
Category | Utilities |
---|---|
Export Size | 194 B |
Last Changed | 4 weeks ago |
SSR compatibility isSupported
Usage
import { useSupported } from '@vueuse/core'
const isSupported = useSupported(() => navigator && 'getBattery' in navigator)
if (isSupported.value) {
// do something
navigator.getBattery
}
Type Declarations
export declare function useSupported(
callback: () => unknown
): ComputedRef<boolean>
Source
© 2019-present Anthony Fu
Licensed under the MIT License.
https://vueuse.org/core/useSupported/