[Record writing bug] When ajax initiates a get request, one of the two parameters is inexplicably lost--how to obtain the parameters passed by the routing attribute

Business requirements: Clicking a suggestion item in the search suggestion list will jump to a list of articles containing the keyword. Here, to get the clicked suggestion item, that is, keyword, the redirected page is /:keyword, so I need to get keyword as a parameter to initiate an ajax request

A 400 error was reported during debugging, and it was found that the request parameter was missing in the network

The reason is that routing attribute parameters need to be used

this.$route.params.kw,

Guess you like

Origin blog.csdn.net/qq_36722315/article/details/126312629