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/useZoomFactor.md
1---2category: '@Electron'3---45# useZoomFactor67Reactive [WebFrame](https://www.electronjs.org/docs/api/web-frame#webframe) zoom factor.89## Usage1011```ts12import { useZoomFactor } from '@vueuse/electron'1314// enable nodeIntegration if you don't provide webFrame explicitly15// see: https://www.electronjs.org/docs/api/webview-tag#nodeintegration16// Ref result will return17const factor = useZoomFactor()18console.log(factor.value) // print current zoom factor19factor.value = 2 // change current zoom factor20```2122Set initial zoom factor immediately2324```ts25import { useZoomFactor } from '@vueuse/electron'2627const factor = useZoomFactor(2)28```2930Pass a `ref` and the factor will be updated when the source ref changes3132```ts33import { useZoomFactor } from '@vueuse/electron'34import { shallowRef } from 'vue'3536const factor = shallowRef(1)3738useZoomFactor(factor) // zoom factor will match with the ref3940factor.value = 2 // zoom factor will change41```4243## Type Declarations4445```ts46export declare function useZoomFactor(factor: MaybeRef<number>): Ref<number>47export declare function useZoomFactor(48webFrame: WebFrame,49factor: MaybeRef<number>,50): Ref<number>51export declare function useZoomFactor(webFrame: WebFrame): Ref<number>52export declare function useZoomFactor(): Ref<number>53```54