博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
vue router children 不正常显示问题
阅读量:4164 次
发布时间:2019-05-26

本文共 817 字,大约阅读时间需要 2 分钟。

{
path: '/home', component: () => import('../views/home/home.vue'), children: [ {
path: '', name: 'home', component: () => import('../views/home/home.vue'), }, {
path: 'sub', name: 'homeSub', component: () => import('../views/home/subpage.vue') } ] },
问题描述:在项目中使用路由父子是嵌套时,路由不显示页面问题,

解决方法:

1、在父路由得对象里里写入

component: {
render: (e) => e("router-view")},

2、父页面的在vue页面中加入

在这里插入图片描述

路由代码:

{
path: '/home', component: {
render: (e) => e("router-view")}, children: [ {
path: '', name: 'home', component: () => import('../views/home/home.vue'), }, {
path: 'sub', name: 'homeSub', component: () => import('../views/home/subpage.vue') } ] },

3、完美解决,撒花❀❀❀❀❀

转载地址:http://kixxi.baihongyu.com/

你可能感兴趣的文章
Observer模式
查看>>
高性能服务器设计
查看>>
图文介绍openLDAP在windows上的安装配置
查看>>
Pentaho BI开源报表系统
查看>>
Pentaho 开发: 在eclipse中构建Pentaho BI Server工程
查看>>
JSP的内置对象及方法
查看>>
android中SharedPreferences的简单例子
查看>>
android中使用TextView来显示某个网址的内容,使用<ScrollView>来生成下拉列表框
查看>>
andorid里关于wifi的分析
查看>>
Spring MVC和Struts2的比较
查看>>
Hibernate和IBatis对比
查看>>
Spring MVC 教程,快速入门,深入分析
查看>>
Android 的source (需安装 git repo)
查看>>
LOCAL_PRELINK_MODULE和prelink-linux-arm.map
查看>>
Ubuntu Navicat for MySQL安装以及破解方案
查看>>
HTTPS那些事 用java实现HTTPS工作原理
查看>>
oracle函数trunc的使用
查看>>
MySQL 存储过程或者函数中传参数实现where id in(1,2,3,...)IN条件拼接
查看>>
java反编译
查看>>
Class.forName( )你搞懂了吗?——转
查看>>