The article details page is reused. By passing the Id parameter, the jump from the article list to the article details page is realized. The details page content of different page jumps is also different.
Idea: id is used as a parameter, you need to pass the parameter on the list page first, and then get the id through the interface on the details page, so that you can get the content of the list article.
1. Pass parameters on the list page, define click events, click on the list, trigger events, and send parameters.
Click event: the newsClick
parameter passing statement is written in the click method
2. On the details page, get the passed parameter id, and also write it in the method.
Define a local id on the details page to accept the passed parameter id, and connect with the interface.
this.id=this.$route.query.id route parameter
In this way, you can jump between two pages with a parameter id to achieve page reuse