为何input事件不能在父组件捕获?

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

我个人的理解是,小程序中的事件都是从顶层组件往下传递,直到被catch为止。

而我在练习的时候感觉也是这样的,如果未被catch住,那么事件就会一直被capture到。

但是不知道为什么我尝试capture input控件的input事件时失败了。这是为什么?

下面是我写的代码

<view id="inner"capture-bind:input="handleInput">
  inner view
  <input/>
</view>
handleInput: function (evt){
    console.log('handleInput')
  }

当我在input控件输入的时候,控制台并没有输出。

1 回复
weizhao
weizhao1 楼5 年前