I have a custom table that serves as a progress bar and added @click events on each td that will redirect to a specific page. Now, the behavior should be like this:
- User can't skip forward so the
@clickevent to the right items should be disabled. - Only
@clickevent functions when going back.
Template:
<tr>
<td class="circle col-xs-2 col-xs-offset-1"
@click="goRelationship">Relationship</td>
<td class="circle col-xs-2"
@click="goSkills">Skills</td>
<td class="circle col-xs-2"
@click="goPurpose">Purpose</td>
<td class="circle col-xs-2"
@click="goFit">Fit</td>
<td class="circle col-xs-2">Submit</td>
</tr>
Script:
methods: {
goRelationship: function () {
window.location.href = "/v2/review/relationship"
},
goSkills: function () {
window.location.href = "/v2/review/skills"
},
goFit: function () {
window.location.href = "/v2/review/fit"
},
goPurpose: function () {
window.location.href = "/v2/review/purpose"
}
}
relationship taband when I click on theskills tab, I need to prevent it to redirect to that unless it's a backward process.@click.prevent="..."prevents default action. Docs: vuejs.org/v2/guide/events.html#Event-Modifiers