Skip to content

Commit 1f1189f

Browse files
committed
feat: add Vetur support
Close vuejs#381
1 parent daf718f commit 1f1189f

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
"files": [
1616
"dist/*.js",
1717
"dist/vue-router.d.ts",
18+
"vetur/tags.json",
19+
"vetur/attributes.json",
1820
"README.md"
1921
],
2022
"scripts": {
@@ -61,6 +63,10 @@
6163
"peerDependencies": {
6264
"vue": "^3.0.0-beta.20"
6365
},
66+
"vetur": {
67+
"tags": "vetur/tags.json",
68+
"attributes": "vetur/attributes.json"
69+
},
6470
"devDependencies": {
6571
"@microsoft/api-documenter": "^7.8.21",
6672
"@microsoft/api-extractor": "^7.8.1",

vetur/attributes.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"name": {
3+
"type": "string | symbol",
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+
"route": {
7+
"description": "When a `<router-view>` has a `route` prop, it will use that resolved Route Location instead of the current ___location."
8+
},
9+
"to": {
10+
"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."
11+
},
12+
"replace": {
13+
"type": "boolean",
14+
"description": "Setting replace prop will call `router.replace()` instead of `router.push()` when clicked, so the navigation will replace the current history entry."
15+
},
16+
"active-class": {
17+
"type": "string",
18+
"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."
19+
},
20+
"exact-active-class": {
21+
"type": "string",
22+
"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."
23+
}
24+
}

vetur/tags.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"router-view": {
3+
"attributes": ["name", "route"],
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": ["to", "activeClass","exactActiveClass", "custom"],
8+
"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."
9+
}
10+
}

0 commit comments

Comments
 (0)