taro 滚动事件
taro 滚动事件
taro scroll bug
ScrollView
https://nervjs.github.io/taro/docs/components/viewContainer/scroll-view.html
import Taro, { Component, Config } from '@tarojs/taro'
import {
View,
Text,
Image,
Icon,
Button,
Swiper,
SwiperItem,
ScrollView,
} from '@tarojs/components'
import './index.scss'
const log = console.log;
export default class MonthCalendar extends Component {
// config = {
// navigationBarTitleText: '日历-月历'
// }
static defaultProps = {
current: 0,
}
constructor () {
super(...arguments)
this.state = {
current: 0,
}
this.onScrollToLower = this.onScrollToLower.bind(this);
this.onScroll = this.onScroll.bind(this);
}
componentWillMount () { }
componentDidMount () {}
componentWillUnmount () { }
componentDidShow () { }
componentDidHide () { }
onScrollToLower(e) {
log(`e to upper`, e)
}
onScroll(e) {
log(`e`, e)
}
render () {
return (
<ScrollView className='month-calendar-container'
scrollX
scrollWithAnimation
scrollTop='0'
style='height: 50px;'
lowerThreshold='20'
upperThreshold='20'
onScrollToLower={this.onScrollToLower}
onScroll={this.onScroll}>
<View className="month-calendar-item">A</View>
<View className="month-calendar-item">B</View>
<View className="month-calendar-item">C</View>
<View className="month-calendar-item">D</View>
<View className="month-calendar-item">E</View>
</ScrollView>
)
}
}
// MonthCalendar.defaultProps = {
// current: 0,
// }

@charset "UTF-8";
.month-calendar-container{
box-sizing: border-box;
overflow-x: auto;
width: 100vw;
display: flex;
flex-flow: row;
// flex-wrap: nowrap;
// justify-content: center;
background: #F8F8F8;
padding: 2px;
}
// .month-calendar-container::-webkit-scrollbar {
// display: none;
// width: 0 !important;
// height: 0 !important;
// background: transparent;
// }
.month-calendar-item{
min-width: 200px;
height:50px;
background-color:rgb(26,173,25);
margin: 0 2px;
}
shit wx

xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
taro 滚动事件的更多相关文章
- taro 禁用滚动事件
taro 禁用滚动事件 禁止 Modal 蒙层下面的页面的内容跟随滚动 https://github.com/NervJS/taro/issues/3980 https://github.com/Ne ...
- js鼠标滑轮滚动事件绑定(兼容主流浏览器)
/** Event handler for mouse wheel event. *鼠标滚动事件 */ var wheel = function(event) { var delta = 0; if ...
- 鼠标滚动事件兼容性 wheel、onwheel
wheelEvent = "onwheel" in document.createElement("div") ? "wheel" : // ...
- JavaScript----分层导航 滚动事件
分层导航 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3 ...
- js网页滚动条滚动事件实例分析
本文实例讲述了js网页滚动条滚动事件用法.分享给大家供大家参考.具体分析如下: 在做js返回顶部的效果时,要监听网页滚动条滚动事件,这个事件就是:window.onscroll.当onscroll事件 ...
- JS鼠标滚动事件
-----------------------------//鼠标滚动事件以下是JS临听鼠标滚动事件 并且还考虑到了各浏览器的兼容----------------------------------- ...
- Jquery-Mobile滚动事件
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> < ...
- javascript滚动栏响应鼠标滑轮的实现上下滚动事件
实现鼠标滚动滚轮事件: <script type="text/javascript"><pre name="code" class=" ...
- vue监听滚动事件,实现滚动监听
在vue中实现滚动监听和原生js无太大差异,下面是一个简单的demo,可在控制台查看结果 <!DOCTYPE html> <html lang="en"> ...
随机推荐
- 【Coursera】Internet History 读书笔记
前言 这个Internet History 有些令人劝退.电脑无法播放视频.手机不能播放.最后百度了改了hosts文件才可以. 附上解决方法: 解决coursera可以登录但无法播放视频 第一周 第三 ...
- 安装sqlserver 的时候 报错:无法通过Windows功能控制面板自动安装或卸载Windows Server 角色和功能。
无法安装以下功能:.NET Framework 3.5(包括.NET2.0和3.0) 无法通过Windows功能控制面板自动安装或卸载Windows Server 角色和功能. 若要安装Windows ...
- luoguP6754 [BalticOI 2013 Day1] Palindrome-Free Numbers
目录 luoguP6754 [BalticOI 2013 Day1] Palindrome-Free Numbers 简述题意: Solution: Code luoguP6754 [BalticOI ...
- mysqld_exporter的源码分析和定制化(单个mysqld_exporter监控多个数据库实例)
mysqld_exporter是prometheus官方提供的用于监控mysql运行状态的exporter.其相关信息可以参考:https://github.com/prometheus/mysqld ...
- Linux常用命令详解(第一章)(ls、man、pwd、cd、mkdir、echo、touch、cp、mv、rm、rmdir、)
本章命令(共11个): 1 2 3 4 5 6 ls man pwd cd mkdir echo touch cp mv rm rmdir 1. " ls " 作用:列出指定目录下 ...
- 23.centos 7配置网络
1.ifconfig:查看网卡信息 如果centos7 最小化安装没有ifconfig这个命令,可以使用yum install net-tools 来安装. centos7 网卡命名规则: en ...
- 子网划分、变长子网掩码和TCP/IP排错__散知识点
1.IP零子网(ip subnet-zero):这个命令可以允许你在自己的网络设计中使用第一个和最后一个子网.例如,C类掩码192通常只可以提供子网64和128,但在使用了ip subnet-zero ...
- vs中python包安装教程
vs安装python很简单,只需要在vs安装包中选择python就可以了,这里使用的python3.7: 如果有了解,都知道安装python包的指令:"pip install xxx&quo ...
- B - Power Strings
Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc&quo ...
- Manacher(马拉车)算法详解
给定一个字符串,求出其最长回文子串 eg: abcba 第一步: 在字符串首尾,及各字符间各插入一个字符(前提这个字符未出现在串里). 如 原来ma /* a b a b c ...