我在vue-router中使用named views。在兩個組件的內部,我需要獲取道具。vue-router:在使用命名視圖時將道具傳遞到組件
以下代碼顯示路線的定義。第一項不起作用。在組件內部,道具將保持未定義狀態。因此,麪包屑和收集組件越來越沒有財產
第二個例子工程,因爲只有一個組件:
const routes = [
{
path: '/:cid',
name: 'collection',
props: true,
components: {
default: Collection,
breadcrumb: Breadcrumb
}
},
{
path: '/:cid/:iid',
name: 'item',
props: true,
component: Item
},
]
我覺得這個道具屬性只是一個工作,當只有一個組件。
我沒有在文檔中找到解決方案,因此歡迎任何幫助。
這些值可以來自主應用程序? – Martian2049