vue-scroll-lock

Vue component for prevent parent scroll
2,839 31
Install
npm install vue-scroll-lock
Latest Version:0.0.6
Vue:2
License:ISC
Last Updated:Dec 7, 2022
Links: GitHub  ·  npm
Maintainer: smackgg

vue-scroll-lock

一个 VUE 组件:子元素 scroll 父元素容器不跟随滚动(兼容PC、移动端)

【 React 请移步 react-scroll-lock-component 】

文档 & 例子

Document & Demo

使用

npm install vue-scroll-lock --save
// or
yarn add vue-scroll-lock
// main.js
import VueScrollLock from 'vue-scroll-lock'

Vue.use(VueScrollLock)

// ***.vue
<scroll-lock>
  <div class="content">
    // ...something
  </div>
</scroll-lock>
参数 描述 类型 可选值 默认值
lock 是否阻止父级滚动 Boolean true/false true
bodyLock 是否阻止body容器滚动 Boolean true/false false

贡献

欢迎 Star、PR

// install
npm install | yarn

// dev
npm run dev

THANKS

移动端的实现参考张鑫旭的web移动端浮层滚动阻止window窗体滚动JS/CSS处理

LICENSE

MIT

Related Packages

vue-prevent-parent-scroll

A Vue directive that prevents vertical scrolling outside the current element whe...

15,247 20
easyscroll

this is a tiny scroll bar plugin for vue2.0

871 41
vue-dragscroll

vue directive to make a scrollable element scroll by draging to the scroll direc...

1,541,547 264
vue3-smooth-scroll

Simple vue smooth scroll

209,775 34
vue2-smooth-scroll

Simple vue smooth scroll

127,387 121

Version History

Version Released Vue License
0.0.6 ^2.5.9 ISC
0.0.5 ^2.5.9 ISC
0.0.4 ^2.5.9 ISC
0.0.3 ^2.5.9 ISC
0.0.2 ^2.5.9 ISC