now there is a demand like this: click on an item in the commodity list (figure 1), and you will get the id, of the product and then pass it into the commodity details interface (figure 2). After receiving the id of the commodity, the commodity details interface sends a http request to the database according to this id, thus requesting the data, and then taking out the corresponding commodity name, merchandise image, commodity price, thus realizing the style of figure 2.
1
figure 2
I use vue,vue-router, to surf the Internet and find some information, but I don"t quite understand how to request data from the database according to the commodity id. I work as a front-end developer, so I want to simulate a database , refer to the Vue simulation data, and route to the product details page , but I don"t quite understand it, and I don"t know how to write it. to write a simple example , the gods help me to see how to write this requirement. Thank you