vue3 中屏蔽控制台中的警告信息

故事 / 2023-07-15 / 原文

 

main.js中

const app = Vue.createApp({});

// 屏蔽错误信息
app.config.errorHandler = () => null;
// 屏蔽警告信息
app.config.warnHandler = () => null;

app.mount("#app");