一个组件怎么绑定多个事件、数字溢出问题?
发布于 6 年前 作者 na69 4561 次浏览 来自 问答

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

3 回复

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

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

大数的话可以用string来处理

多绑定个bindtouchstart或者bindtouchend

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

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

回到顶部