Skip to content

feat: Update vue router docs for new option #6413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,7 @@ import Bar from "@/components/Bar";
Vue.use(Router);

const router = new Router({
routes: [
{
path: "/",
name: "HelloWorld",
component: HelloWorld,
},
{ path: "/foo/:id", component: Foo },
{ path: "/bar", component: Bar },
],
// your router configuration
});

Sentry.init({
Expand All @@ -53,3 +45,19 @@ new Vue({
template: "<App/>",
});
```

## Configuration

You can pass an optional configuration object as second argument to the router instrumentation:

```javascript
vueRouterInstrumentation(vueRouter, {
routeLabel: "path"
});
```

The available options are:

| Key | Type | Default | Description |
| ------------ | ------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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. |