My website has two pages set up for routing:
Home > Results
On the 'Home' page, I have a button/link that is not inside a <route-view/>
. I want this button to redirect to Results.vue
while passing a parameter.
The parameter, named activeTab
, should open the desired vue-tabs
. Currently, I am unable to achieve this as it is not receiving any input from the variable.
Here is the code:
Home.vue
<div class="row"> <Notes refName="Relationship" /> <Notes refName="Support" /> </div> ... <script> import Notes from '@/components/Monthlynotes.vue' export default { name: 'home', components: { Notes }, </script>
/components/Monthlynotes.vue
<b-card> <p class="card-text">{{ refName }}</p> <b-link class="right" :activeTab="refName" href="/results">More</b-link> </b-card> ... <script> export default { props: { refName: String, }, </script>
Results.vue
<vue-tabs type="pills" v-model="tabName"> <v-tab title="Relationship"> <RelDT msg="Results view"/> </v-tab> <v-tab title="Support"> <SupDT msg="Results view"/> </v-tab> </vue-tabs> ... <script> import RelDT from '@/components/DataTable.rel.vue' import SupDT from '@/components/DataTable.sup.vue' export default { name: 'results', props: { activeTab: String }, components: { RelDT, SupDT, }, data() { return { tabName: activeTab } } } </script>
App
<router-link :to="{name:'results', param:{activeTab}}">Results</router-link>
How can I ensure that this <b-link>
routes properly if it were a <route-link />
instead?