Skip to content

Commit 003fb32

Browse files
committed
[docs] v-link-active
1 parent da9423e commit 003fb32

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/en/link.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,22 @@ The active link class name can be configured with the `linkActiveClass` option w
3737
<a v-link="{ path: '/a', activeClass: 'custom-active-class' }"></a>
3838
```
3939

40+
#### Applying Active Classes to Another Element
41+
42+
> 0.7.8+
43+
44+
Sometimes we may want the active classes to be applied to a wrapping element rather than the `<a>` element itself. You can do so by adding `v-link-active` to a parent element:
45+
46+
``` html
47+
<ul>
48+
<li v-link-active>
49+
<a v-link="{ path: '/xxx' }">Go</a>
50+
</li>
51+
</ul>
52+
```
53+
54+
`v-link` will locate the closest parent element that has `v-link-active` and apply the active classes on that element instead.
55+
4056
#### Other Configuration Options
4157

4258
- **replace**

0 commit comments

Comments
 (0)