Skip to content

Commit

Permalink
补充2.2.0新增的事件修饰符
Browse files Browse the repository at this point in the history
  • Loading branch information
lyl107025 committed Apr 5, 2017
1 parent c18537c commit dd2eb5a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/v2/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1447,8 +1447,12 @@ type: api
- `.prevent` - 调用 `event.preventDefault()`
- `.capture` - 添加事件侦听器时使用 capture 模式。
- `.self` - 只当事件是从侦听器绑定的元素本身触发时才触发回调。
- `.{keyCode | keyAlias}` - 只当事件是从侦听器绑定的元素本身触发时才触发回调
- `.{keyCode | keyAlias}` - 只当事件是从特定键触发时才触发回调
- `.native` - 监听组件根元素的原生事件。
- `.once` - 只触发一次回调。
- `.left` - (2.2.0) 只当点击鼠标左键时触发。
- `.right` - (2.2.0) 只当点击鼠标右键时触发。
- `.middle` - (2.2.0) 只当点击鼠标中键时触发。

- **用法:**

Expand Down Expand Up @@ -1487,6 +1491,9 @@ type: api

<!-- 键修饰符,键代码 -->
<input @keyup.13="onEnter">

<!-- 点击回调只会触发一次 -->
<button v-on:click.once="doThis"></button>
```

在子组件上监听自定义事件(当子组件触发 “my-event” 时将调用事件处理器):
Expand Down

0 comments on commit dd2eb5a

Please sign in to comment.