V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
gzf6
V2EX  ›  Vue.js

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

  •  
  •   gzf6 · Mar 10, 2021 · 3356 views
    This topic created in 1884 days ago, the information mentioned may be changed or developed.

    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 replies    2021-11-22 17:40:27 +08:00
    gzf6
        1
    gzf6  
    OP
       Mar 10, 2021
    因为我路由是分模块文件的,应该统一导出一个 layout 给这些模块用,结果我每个模块都各自引入了一个 layout ,笨死了 😄
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1000 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 18:59 · PVG 02:59 · LAX 11:59 · JFK 14:59
    ♥ Do have faith in what you're doing.