From: Eduardo San Martin Morote Date: Tue, 4 Aug 2020 14:52:02 +0000 (+0200) Subject: feat: add Vetur support X-Git-Tag: v4.0.0-beta.6~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f1189fd23dc6ec318edd5d7e8f225b467d4d386;p=thirdparty%2Fvuejs%2Frouter.git feat: add Vetur support Close #381 --- diff --git a/package.json b/package.json index 304f0dea..1e54abd2 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,8 @@ "files": [ "dist/*.js", "dist/vue-router.d.ts", + "vetur/tags.json", + "vetur/attributes.json", "README.md" ], "scripts": { @@ -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", diff --git a/vetur/attributes.json b/vetur/attributes.json new file mode 100644 index 00000000..355b93f2 --- /dev/null +++ b/vetur/attributes.json @@ -0,0 +1,24 @@ +{ + "name": { + "type": "string | symbol", + "description": "When a `` 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 `` 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." + } +} diff --git a/vetur/tags.json b/vetur/tags.json new file mode 100644 index 00000000..73c5e275 --- /dev/null +++ b/vetur/tags.json @@ -0,0 +1,10 @@ +{ + "router-view": { + "attributes": ["name", "route"], + "description": "Component that renders the matched component for the current location. Components rendered by `` can also contain their own `` to render nested routes." + }, + "router-link": { + "attributes": ["to", "activeClass","exactActiveClass", "custom"], + "description": "Component that renders an `` 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." + } +}