我在下面定義了一條路線:{ path: 'fit-details', name: 'fit-details', component: Fitment, props: true},我正在使用來自州的數據通過我的路線傳遞道具:this.$router.push({ path: 'fit-details', query: { year: this.query.year, make: this.query.make, model: this.query.model }})我看到路由在通過時得到了正確定義:www.placeholder.com?year=2008&make=Acura&model=MDX最后在我的接收組件中,我有 props 實例化:export default { props: ['year', 'make', 'model'],},但是由于某種原因我無法訪問組件中的這些數據。任何幫助將不勝感激,老實說,我在 Vue 路由器方面不是最好的
如何在 Vue 組件內訪問 Vue 路由器中傳遞的道具?
汪汪一只貓
2023-03-24 16:18:54