Skip to content

Commit

Permalink
docs(router-link): add how to use @click with router-link
Browse files Browse the repository at this point in the history
closes vuejs#1188
  • Loading branch information
Biliana Valeva committed Oct 14, 2017
1 parent ef4a046 commit 4f18604
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/en/api/router-link.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,13 @@ Sometimes we may want the active class to be applied to an outer element rather
```

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>`.

### Using `@click` with `<router-link>`

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:

```html
<router-link @click.native="doTheThing" to="/foo">
/foo
</router-link>
```

0 comments on commit 4f18604

Please sign in to comment.