@mitojs/vue
This guide preserves integration examples from earlier SDK releases. Version 4 requires an ES2015-capable runtime and drops Internet Explorer support. Open the v4 quickstart
Try the Vue 2 and Vue 3 demos
Section titled “Try the Vue 2 and Vue 3 demos”- Vue 2 error monitoring and request tracing: pass the Vue constructor to the SDK and inspect an HTTP 500 report and its breadcrumbs.
- Vue 3 error monitoring and report inspector: pass the app from createApp(), trigger a component error, and inspect its report JSON.
Both examples use MitoJS 4.0.0 and capture demo reports locally, without a production backend.
⚠️ attention
Section titled “⚠️ attention”If you want to import in weixin miniprograme,please replace @mitojs/browser to @miotjs/wx-mini
🛠️ Install
Section titled “🛠️ Install”# using npmnpm i @mitojs/vue @mitojs/browser# using yarnyarn add @mitojs/vue @mitojs/browser🥳 Usage
Section titled “🥳 Usage”Vue2.X
Section titled “Vue2.X”// main.jsimport Vue from 'vue'import { init } from '@mitojs/browser'import { vuePlugin } from '@mitojs/vue'
// multiple instancesconst MitoInstance = init({ vue: Vue, dsn: 'https://test.com/yourInterface', maxBreadcrumbs: 100},[vuePlugin])Vue3.x
Section titled “Vue3.x”// main.tsimport { createApp } from 'vue'import App from './App.vue'import { init } from "@mitojs/browser";import { vuePlugin } from "@mitojs/vue";
const app = createApp(App)const MitoInstance = init({ vue: app, dsn: 'https://test.com/yourInterface', maxBreadcrumbs: 100},[vuePlugin])