dongtingyue
V2EX  ›  问与答

vue 支持应用嵌套么?

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

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

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

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