0👍
I finally used Vue methods to solve the problem.
Let <a></a>
listen click event, and pass myCase.id
to the methods.
<td>
<a href="" @click.prevent="goLink(myCase.id)" class='btn btn-danger'>Go to link</a>
</td>
Vue methods:
goLink(id) {
let removeLink = window.location.href; // get current link's text
let repeatWord = removeLink.search('open/detail'); // check if there is repeat words
if (repeatWord > 0) {
location.href = `../${id}`; // other condition
} else {
location.href = `../open/detail/${id}`; // first time click
}
},
- [Vuejs]-Debugging node/prime vue webapp in vs code not hitting break points
- [Vuejs]-One array of object pulls data while other doesn't
Source:stackexchange.com