Airbrake's Vue configuration page is still about Vue 2:
Vue.config.errorHandler = function (err, vm, info) {
airbrake.notify({
error: err,
params: {info: info}
});
}
What is the equivalent for Vue.js 3?
The createApp API allows multiple Vue applications to co-exist on the same page, each with its own scope for configuration and global assets: js const app1 = createApp({ /* ... */ }) app1.
It is definitely advisable to use Vue 3 in 2022. The only exceptions are when you already have a large code-base or your dependencies do not yet support Vue 3. However, in most cases, even to make your large code-bases compatible with Vue 3, you need to do minimal changes.
To use Suspense, you put the asynchronous component into the default slot and your fallback loading state into the fallback slot. An asynchronous component is one of two things: A component with an async setup function — returning a Promise or using top-level await with script setup.
Other changes in Vue 3:Virtual DOM rewrite for better performance and improved TypeScript support. Native portals – now called Teleport. Fragments (virtual elements that won't be rendered in the DOM tree) More flexibility for global mounting.
It's the same in vue 3 with a little change which is the use of Vue instead (instance of createApp()) instance of Vue
class :
import { createApp } from "vue";
import App from "./App.vue";
let app=createApp(App)
app.config.errorHandler = function (err, vm, info) {
airbrake.notify({
error: err,
params: {info: info}
});
}
app.mount("#app");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With