.
1.看以上錯誤 "TypeError: Cannot read property 'path' of null".說明是執行了null.path導致報錯,
那么正常情況下應該是有一個數組,path是數組里面的其中一個值,但是返回的數據為null,賦值給了這個數組。
所以執行array.path時就變成了null.path,那么我們就需要去尋找這個數組的來源,確保它不為空且不為null.
2.定位出錯的組件:看層級知道出錯的組件為CommonHeader.vue.從上往下的層級關系為
<Root>--<App>--<main>--<ElContainer>--<ElHeader>--<CommonHeader>