Pulled ALL skills from 15 source repositories: - anthropics/skills: 16 (docs, design, MCP, testing) - obra/superpowers: 14 (TDD, debugging, agents, planning) - coreyhaines31/marketingskills: 25 (marketing, CRO, SEO, growth) - better-auth/skills: 5 (auth patterns) - vercel-labs/agent-skills: 5 (React, design, Vercel) - antfu/skills: 16 (Vue, Vite, Vitest, pnpm, Turborepo) - Plus 13 individual skills from various repos Mosaic Stack is not limited to coding — the Orchestrator and subagents serve coding, business, design, marketing, writing, logistics, analysis, and more. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
67 lines
1.1 KiB
Markdown
67 lines
1.1 KiB
Markdown
---
|
|
category: Sensors
|
|
---
|
|
|
|
# useScrollLock
|
|
|
|
Lock scrolling of the element.
|
|
|
|
## Usage
|
|
|
|
```vue
|
|
<script setup lang="ts">
|
|
import { useScrollLock } from '@vueuse/core'
|
|
import { useTemplateRef } from 'vue'
|
|
|
|
const el = useTemplateRef('el')
|
|
const isLocked = useScrollLock(el)
|
|
|
|
isLocked.value = true // lock
|
|
isLocked.value = false // unlock
|
|
</script>
|
|
|
|
<template>
|
|
<div ref="el" />
|
|
</template>
|
|
```
|
|
|
|
## Directive Usage
|
|
|
|
```vue
|
|
<script setup lang="ts">
|
|
import { vScrollLock } from '@vueuse/components'
|
|
|
|
const data = ref([1, 2, 3, 4, 5, 6])
|
|
const isLocked = ref(false)
|
|
const toggleLock = useToggle(isLocked)
|
|
</script>
|
|
|
|
<template>
|
|
<div v-scroll-lock="isLocked">
|
|
<div v-for="item in data" :key="item">
|
|
{{ item }}
|
|
</div>
|
|
</div>
|
|
<button @click="toggleLock()">
|
|
Toggle lock state
|
|
</button>
|
|
</template>
|
|
```
|
|
|
|
## Type Declarations
|
|
|
|
```ts
|
|
/**
|
|
* Lock scrolling of the element.
|
|
*
|
|
* @see https://vueuse.org/useScrollLock
|
|
* @param element
|
|
*/
|
|
export declare function useScrollLock(
|
|
element: MaybeRefOrGetter<
|
|
HTMLElement | SVGElement | Window | Document | null | undefined
|
|
>,
|
|
initialState?: boolean,
|
|
): WritableComputedRef<boolean, boolean>
|
|
```
|