Skip to content
/ ollo Public

公众号H5🈲触顶后允许局部元素滚动解决方案

License

Notifications You must be signed in to change notification settings

philuo/ollo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ollo

Vue3环境插件

注册局部滚动指令

  • 支持响应式变量
// main.ts (入口文件)
import { createApp } from 'vue';
import { scroller } from 'ollo';
import App from './App.vue';

const app = createApp(App);

app.use(scroller);
app.use(longtouch);
<!-- case 1 -->
<template>
    <textarea v-scroll />
</template>

<!-- case 2 -->
<template>
    <textarea v-scroll="true" />
</template>

<!-- case 3 -->
<template>
    <textarea v-scroll="false" />
</template>

<!-- case 4 -->
<template>
    <textarea v-scroll="shouldScroll" />
</template>
<!-- case 1 -->
<template>
    <!-- 单指按下400ms, 触发 -->
    <textarea v-longtouch="callback" />
</template>

<!-- case 2 -->
<template>
    <!-- 单指按下500ms, 触发 -->
    <textarea v-longtouch:500="callback" />
</template>

<script setup>
function callback() {
    // doSomething
}
</script>

About

公众号H5🈲触顶后允许局部元素滚动解决方案

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published