From 7833934a94600fb90c9af75c3ff9773a36d9f6b5 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Fri, 3 Mar 2023 13:32:29 +0100 Subject: [PATCH] feat: Update vue router docs for new option --- .../configuration/integrations/vue-router.mdx | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/platforms/javascript/guides/vue/configuration/integrations/vue-router.mdx b/src/platforms/javascript/guides/vue/configuration/integrations/vue-router.mdx index 6cb77f2deb877..7a18a8e6a6a91 100644 --- a/src/platforms/javascript/guides/vue/configuration/integrations/vue-router.mdx +++ b/src/platforms/javascript/guides/vue/configuration/integrations/vue-router.mdx @@ -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({ @@ -53,3 +45,19 @@ new Vue({ template: "", }); ``` + +## 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. |