Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Apply VueUse composables in Vue 3/Nuxt projects to replace custom implementations with battle-tested utilities.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/usePerformanceObserver.md
1---2category: Browser3---45# usePerformanceObserver67Observe performance metrics.89## Usage1011```ts12import { usePerformanceObserver } from '@vueuse/core'1314const entrys = ref<PerformanceEntry[]>([])15usePerformanceObserver({16entryTypes: ['paint'],17}, (list) => {18entrys.value = list.getEntries()19})20```2122## Type Declarations2324```ts25export type UsePerformanceObserverOptions = PerformanceObserverInit &26ConfigurableWindow & {27/**28* Start the observer immediate.29*30* @default true31*/32immediate?: boolean33}34/**35* Observe performance metrics.36*37* @see https://vueuse.org/usePerformanceObserver38* @param options39*/40export declare function usePerformanceObserver(41options: UsePerformanceObserverOptions,42callback: PerformanceObserverCallback,43): {44isSupported: UseSupportedReturn45start: () => void46stop: () => void47}48```49