Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

这个现在还监听不到vue产生的错误吗? #43

Open
18823752727 opened this issue Aug 22, 2018 · 1 comment
Open

这个现在还监听不到vue产生的错误吗? #43

18823752727 opened this issue Aug 22, 2018 · 1 comment

Comments

@18823752727
Copy link

使用vue-cli构建的项目,vue产生的一些错误信息没有捕获到

@huoher
Copy link

huoher commented Aug 25, 2020

Vue clis3以上,需要在main.js中添加

import BJ_REPORT from 'badjs-report'
BJ_REPORT.init({
    id: 3,
    url: "http://127.0.0.1:8081/badjs",
    repeat: 10,
    random: 1,
})
Vue.use(ElementUI);
Vue.config.errorHandler = (error, vm, i) => {
    BJ_REPORT.report(error)
    console.error(error)
}
Vue.config.warnHandler = (msg, vm, trace) => {
    BJ_REPORT.report({
        msg: `warm:${msg}`,
        target: Object.keys(vm.$refs) + '',
    })
    console.warn(msg);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants