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

子页面 component 可以显示 render 方式不显示

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

    父页面

    <template>
        <div>
            home
            <router-view></router-view>
        </div>
      
    </template>
    

    路由配置

    import Home from './children/home.vue'
    {
                path: '/project/diy/7',
                name: 'previewHome',
                component: Home,
                children: [
                    {
                        path: '',
                        name: 'emptyView123123123123',
                        // component: C1,可以显示
                        //下面这种不显示
                        render: function (createElement) {
                            return createElement('p', {
                                domProps: {
                                    innerHTML: 'hello !'
                                }
                            })
                        }
                    }
                ]
            },
    

    是什么原因?
    目的是要动态载入 vue 页面。vue 页面代码保存在数据库中。

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5548 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 05:47 · PVG 13:47 · LAX 22:47 · JFK 01:47
    ♥ Do have faith in what you're doing.