1.将props设为true。 作用同this. $ routes.params。但是推荐使用props,因为要让组件和路由解耦,所以尽量不要在组件中使用$routes。 { path:'/categories/edit',component:CategoryEdit,props:true}, 这样在组件中: props: { id: {} }, 可以直接用 this.id取值,而可以不用 this.$route.params.id 取值 2.将props设为对象