-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #113 from GuoXiCheng/dev-c
update docs
- Loading branch information
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# 事件处理参数 | ||
|
||
## 访问自定义参数 | ||
|
||
内联事件处理器允许传入自定义参数以代替原生事件。 | ||
|
||
<<< @/../projects/vue-sandbox/src/components/EventHandling/AccessCustomParameters.vue | ||
|
||
## 访问原生事件参数 | ||
|
||
内联事件处理器允许接收一个特殊的`$event`参数或使用内联箭头函数来访问原生事件。 | ||
|
||
<<< @/../projects/vue-sandbox/src/components/EventHandling/AccessEventParameter.vue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# 事件处理器 | ||
|
||
## 监听事件 | ||
|
||
使用`v-on`指令(简写为`@`)来监听 DOM 事件。 | ||
|
||
例如:`v-on:click="handleClick"` 或 `@click="handleClick"` | ||
|
||
## 内联事件处理器 | ||
|
||
事件被触发时执行内联的表达式语句。 | ||
|
||
<<< @/../projects/vue-sandbox/src/components/EventHandling/InlineHander.vue | ||
|
||
## 方法事件处理器 | ||
|
||
事件被触发时执行一个指向组件上定义的方法的属性名或是路径。 | ||
|
||
:::tip | ||
方法事件处理器会自动接收原生 DOM 事件并触发执行。 | ||
::: | ||
|
||
<<< @/../projects/vue-sandbox/src/components/EventHandling/MethodHandler.vue |