Laravel 在路由器vue中传递参数

Laravel 在路由器vue中传递参数,laravel,vue.js,components,Laravel,Vue.js,Components,我有个问题。我不能让它工作 我有一个叫做Projet的组件。在它里面,我有一段代码: 我想当我在项目中点击它会带我到另一个详细信息页面 但什么也没有发生: {path: '/detail/:id', component: detail} 这就是我的组件中的代码 <tr v-for="projet in projets" :key="projet.id" > <router-link :to="{ name: 'detail', param

我有个问题。我不能让它工作

我有一个叫做Projet的组件。在它里面,我有一段代码:

我想当我在项目中点击它会带我到另一个详细信息页面 但什么也没有发生:

{path: '/detail/:id', component: detail}
这就是我的组件中的代码

        <tr v-for="projet in projets" :key="projet.id" >
           <router-link :to="{ name: 'detail', params: {id:  projet.id } }" style="text-decoration:none; color:black;">        <td>{{ projet.name }}</td></router-link>
                  <td>{{ projet.owner }}</td>
                  <td>{{ projet.durre }}</td>

                  <td>-------</td>
                  <td><i  data-toggle="modal" data-target="#description" class="fas fa-scroll" ></i></td>
                  <td>{{projet.budget}}</td>
                  <td>      <a href="#" @click="deleteProjet(projet.id)" ><i class="fas fa-trash-alt"></i></a>

我想你错过了路由器的名字

试试这个

{path: '/detail/:id', component: detail, name: 'detail'}
试试这个:


<router-link :to="'detail/' + projet.id" style="text-decoration:none; color:black;">     

然后记录你的项目@anisproject.id的工作情况,他会带我到其他页面,但新页面的url中没有id。如果找不到projet.id,则会显示未定义。您将重定向到/detail/undefined页面。请将我转到此URL。如果您的模板未编译,请检查vue实例、vue文件。并在控制台日志中查看