Skip to content

Commit ea03de1

Browse files
committed
feat: add vetur tags and attributes
1 parent fe41809 commit ea03de1

File tree

3 files changed

+65
-1
lines changed

3 files changed

+65
-1
lines changed

package.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,14 @@
1717
"files": [
1818
"src",
1919
"dist/*.js",
20-
"types/*.d.ts"
20+
"types/*.d.ts",
21+
"vetur/tags.json",
22+
"vetur/attributes.json"
2123
],
24+
"vetur": {
25+
"tags": "vetur/tags.json",
26+
"attributes": "vetur/attributes.json"
27+
},
2228
"keywords": [
2329
"vue",
2430
"router",

vetur/attributes.json

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": {
3+
"type": "string",
4+
"description": "When a `<router-view>` has a `name` prop, it will render the component with the corresponding name in the matched route record's components option."
5+
},
6+
"to": {
7+
"description": "Denotes the target route of the link. When clicked, the value of the `to` prop will be internally passed to `router.push()`, so the value can be either a string or a location descriptor object."
8+
},
9+
"append": {
10+
"type": "boolean",
11+
"description": "Setting the append prop always appends the relative path to the current path. For example, assuming we are navigating from /a to a relative link b, without append we will end up at /b, but with append we will end up at /a/b."
12+
},
13+
"tag": {
14+
"description": "Specify which tag to render to, and it will still listen to click events for navigation. By default, an `a` tag is rendered."
15+
},
16+
"event": {
17+
"description": "Specify the event(s) that can trigger the link navigation. By default, the `click` event triggers a navigation."
18+
},
19+
"replace": {
20+
"type": "boolean",
21+
"description": "Call `router.replace()` instead of `router.push()` when the link is clicked, so the navigation replaces the current history entry."
22+
},
23+
"exact": {
24+
"description": "The default active class matching behavior is inclusive match. For example, `<router-link to=\"/a\">` will get this class applied as long as the current path starts with /a/ or is /a.\nOne consequence of this is that `<router-link to=\"/\">` will be active for every route! To force the link into \"exact match mode\", use the exact prop: `<router-link to=\"/\" exact>`"
25+
},
26+
"active-class": {
27+
"type": "string",
28+
"description": "Configure the active CSS class applied when the link is active. Note the default value can also be configured globally via the `linkActiveClass` router constructor option."
29+
},
30+
"exact-active-class": {
31+
"type": "string",
32+
"description": "Configure the active CSS class applied when the link is exactly active. Note the default value can also be configured globally via the `linkExactActiveClass` router constructor option."
33+
},
34+
"aria-current-value": {
35+
"options": ["page", "step", "location", "date", "time", "true", "false"],
36+
"description": "Configure the value of `aria-current` when the link is active with exact match. It must be one of the [allowed values for `aria-current`](https://www.w3.org/TR/wai-aria-1.2/#aria-current) in the ARIA spec. In most cases, the default of `page` should be the best fit."
37+
}
38+
}

vetur/tags.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"router-view": {
3+
"attributes": ["name"],
4+
"description": "Component that renders the matched component for the current location. Components rendered by `<router-view>` can also contain their own `<router-view>` to render nested routes."
5+
},
6+
"router-link": {
7+
"attributes": [
8+
"to",
9+
"replace",
10+
"append",
11+
"tag",
12+
"active-class",
13+
"exact",
14+
"event",
15+
"exact-active-class",
16+
"aria-current-value"
17+
],
18+
"description": "Component that renders an `<a>` with the correct `href` attribute and click listeners to trigger a local navigation when clicked. Can also customize its rendering by providing the `custom` prop and using its `v-slot` API."
19+
}
20+
}

0 commit comments

Comments
 (0)