V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
gzf6
V2EX  ›  Vue.js

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

  •  
  •   gzf6 · 2021-03-10 11:01:30 +08:00 · 2771 次点击
    这是一个创建于 1355 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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>
    
    2 条回复    2021-11-22 17:40:27 +08:00
    gzf6
        1
    gzf6  
    OP
       2021-03-10 11:18:51 +08:00
    因为我路由是分模块文件的,应该统一导出一个 layout 给这些模块用,结果我每个模块都各自引入了一个 layout ,笨死了 😄
    mashirozx
        2
    mashirozx  
       2021-11-22 17:40:27 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2978 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 14:14 · PVG 22:14 · LAX 06:14 · JFK 09:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.