请问有人用 Vue Router 4 出现过提示 ‘Vue received a Component which was made a reactive object’ 吗?

2021-03-10 11:01:30 +08:00
 gzf6

Vue3+VueRouter4+Vite2

runtime-core.esm-bundler.js:38 [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`. 
Component that was made reactive:  {name: "Layout", components: {…}, __scopeId: "data-v-13877386", setup: ƒ, render: ƒ, …} 
  at <RouterView> 
  at <App>
2612 次点击
所在节点    Vue.js
2 条回复
gzf6
2021-03-10 11:18:51 +08:00
因为我路由是分模块文件的,应该统一导出一个 layout 给这些模块用,结果我每个模块都各自引入了一个 layout ,笨死了 😄
mashirozx
2021-11-22 17:40:27 +08:00

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/760245

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX