Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/438.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 未找到嵌套路由vue js_Javascript_Vue.js_Vuejs2_Vue Router - Fatal编程技术网

Javascript 未找到嵌套路由vue js

Javascript 未找到嵌套路由vue js,javascript,vue.js,vuejs2,vue-router,Javascript,Vue.js,Vuejs2,Vue Router,我从app.js let routes=[{ 路径:“/dashboard”, 组件:需要(“./components/Dashboard.vue”) }, { 路径:“/tour”, 组件:需要(“./components/Index.vue”), 儿童:[{ 名称:“创建”, 路径:'/create', 组件:需要(“./components/product/Create.vue”) }] }, { 路径:“*”, 组件:需要(“./components/NotFound.vue”) }

我从
app.js

let routes=[{
路径:“/dashboard”,
组件:需要(“./components/Dashboard.vue”)
},
{
路径:“/tour”,
组件:需要(“./components/Index.vue”),
儿童:[{
名称:“创建”,
路径:'/create',
组件:需要(“./components/product/Create.vue”)
}]
},
{
路径:“*”,
组件:需要(“./components/NotFound.vue”)
}

];创建一个新文件,并通过组件文件夹中的Tourview.vue保存

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

<script>
  export default {
    data() {
      return {      
      };
    },
    methods: {

  };
  };
</script>

如果我是正确的,您应该删除路径
/create
前面的
/code>property@daanvanham谢谢你的建议。我试了一下,只是url从
http://localhost:3000/tour
http://localhost:3000/tour/create
但Create.vue组件不会加载。控制台也登录了Created.vue组件,但在单击“添加新按钮”按钮时不会显示任何内容。是否还需要更新master.blade.php中的
路由器链接
?仅更新index.vue文件中的Add New
let routes = [{
    path: "/dashboard",
    component: require("./components/Dashboard.vue")
  },
  {
    path: "/tour",
    component: require("./components/Tourview.vue"),
    children: [
     {
      path:'',
      component: require("./components/Index.vue")
     },
    {
      name: 'create',
      path: '/create',
      component: require('./components/product/Create.vue')
    }]

  },
  {
    path: "*",
    component: require("./components/NotFound.vue")
  }
];