美文网首页
router文件中使用vue的h方法渲染页面

router文件中使用vue的h方法渲染页面

作者: 曾祥辉 | 来源:发表于2021-04-10 18:29 被阅读0次

直接上代码

//router.ts
import { createWebHashHistory, createRouter } from 'vue-router';
import { h } from 'vue';
const history = createWebHashHistory();
import index from '@/views/index.vue';
export const router = createRouter({
    history,
    routes: [
        {
            path: '/home',
            component: h(index, key: 'index'})
        }
         ]
 }

h是vue渲染虚拟DOM的方法

相关文章

网友评论

      本文标题:router文件中使用vue的h方法渲染页面

      本文链接:https://www.haomeiwen.com/subject/famnkltx.html