Skip to content
Open
Show file tree
Hide file tree
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 @@ -60,7 +60,7 @@ Sentry.init({
integrations: [
Sentry.vueIntegration({
tracingOptions: {
trackComponents: true
trackComponents: true,
hooks: ["mount", "update", "unmount"],
},
}),
Expand Down
28 changes: 24 additions & 4 deletions docs/platforms/javascript/guides/vue/features/vue-router.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,30 @@ Our routing instrumentation supports `vue-router` v2, v3, and v4.

Here is a full example of how to use it:

```javascript {tabTitle:Vue 3} {filename:main.js} {mdExpandTabs}
import { createApp } from "vue";
import { createRouter } from "vue-router";
import * as Sentry from "@sentry/vue";
import App from "./App.vue";

const app = createApp(App);

const router = createRouter({
// your router configuration
});

Sentry.init({
app,
dsn: "___PUBLIC_DSN___",
tracesSampleRate: 1.0,
integrations: [Sentry.browserTracingIntegration({ router })],
});

app.use(router);
app.mount("#app");
```

```javascript {filename:main.js}
```javascript {tabTitle:Vue 2} {filename:main.js}
import Vue from "vue";
import App from "./App";
import * as Sentry from "@sentry/vue";
Expand All @@ -29,9 +51,7 @@ Sentry.init({
Vue,
dsn: "___PUBLIC_DSN___",
tracesSampleRate: 1.0,
integrations: [
Sentry.browserTracingIntegration({ router }),
],
integrations: [Sentry.browserTracingIntegration({ router })],
});

new Vue({
Expand Down
Loading