我當前的 url 是http://localhost:8080/component,在這個頁面中我有一個<a>標簽
<a :href="'/detail/' comp._id"></a>
何時comp._id確定,例如它是6221add333182348e1d70104。
http://localhost:8080/component/detail/6221add333182348e1d70104當我單擊鏈接時,我希望 URL 跳轉到。
但實際上它是http://localhost:8080/detail/6221add333182348e1d70104。
我怎樣才能做到這一點?
uj5u.com熱心網友回復:
您可以添加/component/到您的鏈接。喜歡:<a :href="'/component/detail/' comp._id"></a>
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/437494.html
標籤:html Vue.js Vuejs2 Vue组件 Vue路由器
