Skip to content

Commit 19c42c7

Browse files
authored
feat: Update vue router docs for new option (#6413)
1 parent 433e073 commit 19c42c7

File tree

1 file changed

+17
-9
lines changed
  • src/platforms/javascript/guides/vue/configuration/integrations

1 file changed

+17
-9
lines changed

src/platforms/javascript/guides/vue/configuration/integrations/vue-router.mdx

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,7 @@ import Bar from "@/components/Bar";
2424
Vue.use(Router);
2525

2626
const router = new Router({
27-
routes: [
28-
{
29-
path: "/",
30-
name: "HelloWorld",
31-
component: HelloWorld,
32-
},
33-
{ path: "/foo/:id", component: Foo },
34-
{ path: "/bar", component: Bar },
35-
],
27+
// your router configuration
3628
});
3729

3830
Sentry.init({
@@ -53,3 +45,19 @@ new Vue({
5345
template: "<App/>",
5446
});
5547
```
48+
49+
## Configuration
50+
51+
You can pass an optional configuration object as second argument to the router instrumentation:
52+
53+
```javascript
54+
vueRouterInstrumentation(vueRouter, {
55+
routeLabel: "path"
56+
});
57+
```
58+
59+
The available options are:
60+
61+
| Key | Type | Default | Description |
62+
| ------------ | ------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
63+
| routeLabel | string | `name` | The label to use for the route transactions. Can be either `name` or `path`. When this is `name`, the transaction will use `route.name`, if it is set, and else use the path of the route. By setting this to `path` you can opt-out of this and always use the path. |

0 commit comments

Comments
 (0)