dongtingyue
V2EX  ›  问与答

vue 支持应用嵌套么?

  •  
  •   dongtingyue · Mar 20, 2023 · 1174 views
    This topic created in 1174 days ago, the information mentioned may be changed or developed.

    类似这样
    /demo/1 的页面
    页面内再 new vue
    新的 app 可以局部刷新 路由还是一样的 /demo/1 只是多了参数?flag=xx

    我自己测试了下里面的 app 内容不会显示不知道什么原因也没有执行,created

    heishu
        2
    heishu  
       Mar 21, 2023
    @xiaohundun 这种的话,那其他 component 是算 app 还是 App2 的状态呢,数据共享吗
    xiaohundun
        3
    xiaohundun  
       Mar 21, 2023
    dongtingyue
        4
    dongtingyue  
    OP
       Mar 21, 2023
    @xiaohundun 嵌套已经可以了,但是现在又出现个问题。
    父页面 <router-view></router-view>
    子页面通过 component 的方式可以正常渲染
    通过
    ```
    render: function (createElement) {
    return createElement('h2')
    }
    ```
    无法渲染,是什么原因?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1126 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 55ms · UTC 18:09 · PVG 02:09 · LAX 11:09 · JFK 14:09
    ♥ Do have faith in what you're doing.