[Vue warn]: Vue received a Component which was made a reactive object. This can lead to unnecessary

无缘无故突然爆了这个错误

看文档意思是,vue 引用了一个组建,具体是一个响应的对象,这将会引入一步需要的性能开销,然后就是你应该标记用两个函数去解决

[Vue warn]: Vue received a Component which was made a reactive object. This can lead to unnecessary performance overhead, and should be avoided by marking the component with markRaw or using shallowRef instead of ref.

真的无解 报错截图

[Vue warn]: Vue received a Component which was made a reactive object. This can lead to unnecessary_第1张图片

[Vue warn]: Vue received a Component which was made a reactive object. This can lead to unnecessary_第2张图片
我以为是这个ref 名称导致的,搞了半天,最后没有解决。我吐了。

然后我就在想因为我用了全局组建,是不是组建问题,我又全局搜了引用

[Vue warn]: Vue received a Component which was made a reactive object. This can lead to unnecessary_第3张图片
一个是 路由的组建,也就是根组建,我觉得不应该,毕竟一直都这么写,一个是路由组册使用,因为我写的软件角色是自己定义配置的json 所以会动态配置路由,最后确定了位置,抱着试一试,没想到成功了
[Vue warn]: Vue received a Component which was made a reactive object. This can lead to unnecessary_第4张图片

在这里插入图片描述

改为
[Vue warn]: Vue received a Component which was made a reactive object. This can lead to unnecessary_第5张图片
总结,直到改完,我才明白他是什么意思, 我这里会判断路由,这里的路由使用时动态的,由于应该是静态的,所以有了这个提示,但是以前这么写也没问题,不过确实如他警告的一样原因。

你可能感兴趣的:(异常,vue.js,前端,javascript)