一个组件怎么绑定多个事件、数字溢出问题?

发布于 8 年前作者 na694865 次浏览最后编辑 8 年前来自 ask

一个组件怎么才能绑定多个事件啊?这样试了好几次都不行!!!一个很大的数应该怎么表示呢?数字溢出就显示null应该怎么解决!!!谢谢!!!

WXOPEN Club 内容图片
3 回复
fanxia
fanxia1 楼6 年前

多个view嵌套,每个view绑一个事件。

hanxia
hanxia2 楼6 年前

说说具体的应用场景啊,难道不能在点击的函数里调用多了其他方法吗?

大数的话可以用string来处理

chenming
chenming3 楼6 年前

多绑定个bindtouchstart或者bindtouchend

<view bindtap="tap" bindtouchstart="touchstart">点击我触发多个事件</view>
tap(e){
  console.log('tap', e)
}
touchstart(e){
  console.log('touchstart', e)
}

若认为该回答有用,给回答者点个[ 有用 ],让答案帮助更多的人