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/useZoomLevel.md
1---2category: '@Electron'3---45# useZoomLevel67Reactive [WebFrame](https://www.electronjs.org/docs/api/web-frame#webframe) zoom level.89## Usage1011```ts12import { useZoomLevel } 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 level = useZoomLevel()18console.log(level.value) // print current zoom level19level.value = 2 // change current zoom level20```2122Set initial zoom level immediately2324```ts25import { useZoomLevel } from '@vueuse/electron'2627const level = useZoomLevel(2)28```2930Pass a `ref` and the level will be updated when the source ref changes3132```ts33import { useZoomLevel } from '@vueuse/electron'34import { shallowRef } from 'vue'3536const level = shallowRef(1)3738useZoomLevel(level) // zoom level will match with the ref3940level.value = 2 // zoom level will change41```4243## Type Declarations4445```ts46export declare function useZoomLevel(level: MaybeRef<number>): Ref<number>47export declare function useZoomLevel(48webFrame: WebFrame,49level: MaybeRef<number>,50): Ref<number>51export declare function useZoomLevel(webFrame: WebFrame): Ref<number>52export declare function useZoomLevel(): Ref<number>53```54