Skip to content

Commit 8c2c2c7

Browse files
Lms24imatwawana
andauthored
ref(vue): Add vue-router version support information (#5662)
This adds a note on which vue-router versions are supported by our vue routing instrumentation. Also did some minor cleanup of the code example as it contained some unnecessary lines. Co-authored-by: Isabel <[email protected]>
1 parent cd7c382 commit 8c2c2c7

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,24 @@ redirect_from:
55
- /sdks/react/integrations/vue-router/
66
---
77

8-
If you are using Vue Router, you should use our provided integration to get better, parameterized transaction names. Here is a full example of how to use it:
8+
If you're using Vue Router, you should use our provided routing instrumentation to get better, parameterized transaction names.
99

10-
```javascript
10+
Our routing instrumentation supports `vue-router` v2, v3, and v4.
11+
12+
Here is a full example of how to use it:
13+
14+
```javascript {filename:main.js}
1115
import Vue from "vue";
1216
import App from "./App";
1317
import * as Sentry from "@sentry/vue";
1418
import { BrowserTracing } from "@sentry/tracing";
1519
import Router from "vue-router";
1620
import HelloWorld from "@/components/HelloWorld";
21+
import Foo from "@/components/Foo";
22+
import Bar from "@/components/Bar";
1723

1824
Vue.use(Router);
1925

20-
const Foo = { template: "<div>foo</div>" };
21-
const Bar = { template: "<div>bar</div>" };
22-
2326
const router = new Router({
2427
routes: [
2528
{
@@ -32,21 +35,17 @@ const router = new Router({
3235
],
3336
});
3437

35-
Vue.config.productionTip = false;
36-
3738
Sentry.init({
38-
Vue: Vue,
39+
Vue,
3940
dsn: "___PUBLIC_DSN___",
4041
tracesSampleRate: 1.0,
4142
integrations: [
4243
new BrowserTracing({
4344
routingInstrumentation: Sentry.vueRouterInstrumentation(router),
4445
}),
4546
],
46-
trackComponents: true,
4747
});
4848

49-
/* eslint-disable no-new */
5049
new Vue({
5150
el: "#app",
5251
router,

src/platforms/javascript/guides/vue/features/component-tracking.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Sentry.init({
8787
tracingOptions: {
8888
trackComponents: true;
8989
timeout: 500;
90-
hooks: string['mount', 'update'];
90+
hooks: ['mount', 'update'];
9191
}
9292
})
9393
```

0 commit comments

Comments
 (0)