Skip to content

Commit

Permalink
feat: add Vetur support
Browse files Browse the repository at this point in the history
Close #381
  • Loading branch information
posva committed Aug 4, 2020
1 parent daf718f commit 1f1189f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"files": [
"dist/*.js",
"dist/vue-router.d.ts",
"vetur/tags.json",
"vetur/attributes.json",
"README.md"
],
"scripts": {
Expand Down Expand Up @@ -61,6 +63,10 @@
"peerDependencies": {
"vue": "^3.0.0-beta.20"
},
"vetur": {
"tags": "vetur/tags.json",
"attributes": "vetur/attributes.json"
},
"devDependencies": {
"@microsoft/api-documenter": "^7.8.21",
"@microsoft/api-extractor": "^7.8.1",
Expand Down
24 changes: 24 additions & 0 deletions vetur/attributes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": {
"type": "string | symbol",
"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."
},
"route": {
"description": "When a `<router-view>` has a `route` prop, it will use that resolved Route Location instead of the current location."
},
"to": {
"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."
},
"replace": {
"type": "boolean",
"description": "Setting replace prop will call `router.replace()` instead of `router.push()` when clicked, so the navigation will replace the current history entry."
},
"active-class": {
"type": "string",
"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."
},
"exact-active-class": {
"type": "string",
"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."
}
}
10 changes: 10 additions & 0 deletions vetur/tags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"router-view": {
"attributes": ["name", "route"],
"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."
},
"router-link": {
"attributes": ["to", "activeClass","exactActiveClass", "custom"],
"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."
}
}

0 comments on commit 1f1189f

Please sign in to comment.