In history mode, how do app.vue and vue-router communicate in vue?

history mode:
Project 1:router-link is written in app.vue, refresh the navigation, and the page loads normally.
item 2: the navigation is written in the home file, and in the routing file, it is loaded by route, and the 404 error is reported by refresh.
the question now is why the history mode can be safely used when router-link is written in the portal component, while the second way of writing can only be configured on the back end

Mar.18,2021

webpack is configured by default and has nothing to do with the app.vue component. The questions raised by
cannot be deleted

Menu