Skip to content

Commit 4f18604

Browse files
author
Biliana Valeva
committed
docs(router-link): add how to use @click with router-link
closes vuejs#1188
1 parent ef4a046 commit 4f18604

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: docs/en/api/router-link.md

+10
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,13 @@ Sometimes we may want the active class to be applied to an outer element rather
136136
```
137137

138138
In this case the `<a>` will be the actual link (and will get the correct `href`), but the active class will be applied to the outer `<li>`.
139+
140+
### Using `@click` with `<router-link>`
141+
142+
Sometimes we want to use a `<router-link>` component to benefit from its visited state or other things but manually handle the `@click`. In these cases, you can use the `.native` modifier, for example:
143+
144+
```html
145+
<router-link @click.native="doTheThing" to="/foo">
146+
/foo
147+
</router-link>
148+
```

0 commit comments

Comments
 (0)