You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/components.md
+59Lines changed: 59 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,64 @@
1
1
# Built-in Components
2
2
3
+
## AutoLink
4
+
5
+
- Props:
6
+
7
+
- config
8
+
- Type: `AutoLinkConfig`
9
+
- Required: `true`
10
+
11
+
```ts
12
+
interfaceAutoLinkConfig {
13
+
/**
14
+
* Pattern to determine if the link should be active, which has higher priority than `exact`
15
+
*/
16
+
activeMatch?:string|RegExp
17
+
18
+
/**
19
+
* The `aria-label` attribute
20
+
*/
21
+
ariaLabel?:string
22
+
23
+
/**
24
+
* Whether the link should be active only if the url is an exact match
25
+
*/
26
+
exact?:boolean
27
+
28
+
/**
29
+
* URL of the auto link
30
+
*/
31
+
link:string
32
+
33
+
/**
34
+
* The `rel` attribute
35
+
*/
36
+
rel?:string
37
+
38
+
/**
39
+
* The `target` attribute
40
+
*/
41
+
target?:string
42
+
43
+
/**
44
+
* Text of the auto link
45
+
*/
46
+
text:string
47
+
}
48
+
```
49
+
50
+
```md
51
+
<AutoLink :config="autoLinkConfig" />
52
+
```
53
+
54
+
- Details:
55
+
56
+
This component will automatically render a `<RouteLink>` or `<a>` bases on your configuration.
57
+
58
+
It's recommended to use this component instead of the `<RouteLink>` component if the link can be both internal and external.
59
+
60
+
It has a default slot to render the content of the link (default is `config.text`), and you can also add slots named `before` and `after` to render content before and after the text.
0 commit comments