Skip to content

Commit a072a5f

Browse files
committed
docs: more details about custom
1 parent 0e24ea3 commit a072a5f

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

docs/api/index.md

+18-6
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,25 @@ sidebar: auto
6868
- **Default**: `false`
6969
- **Details**:
7070

71-
Whether `<router-link>` should not wrap its content in an `<a>` element. Useful when using [`v-slot`](#router-link-s-v-slot) to create a custom RouterLink.
71+
Whether `<router-link>` should not wrap its content in an `<a>` element. Useful when using [`v-slot`](#router-link-s-v-slot) to create a custom RouterLink. By default, `<router-link>` will render its content wrapped in an `<a>` element, even when using `v-slot`. Passing the `custom` prop, removes that behavior.
7272

73-
```html
74-
<router-link to="/home" custom v-slot="{ navigate, href, route }">
75-
<a :href="href" @click="navigate">{{ route.fullPath }}</a>
76-
</router-link>
77-
```
73+
- **Examples**:
74+
75+
```html
76+
<router-link to="/home" custom v-slot="{ navigate, href, route }">
77+
<a :href="href" @click="navigate">{{ route.fullPath }}</a>
78+
</router-link>
79+
```
80+
81+
Renders `<a href="/home">/home</a>`.
82+
83+
```html
84+
<router-link to="/home" v-slot="{ route }">
85+
<span>{{ route.fullPath }}</span>
86+
</router-link>
87+
```
88+
89+
Renders `<a href="/home"><span>/home</span></a>`.
7890

7991
### exact-active-class
8092

0 commit comments

Comments
 (0)