[Vuejs]-VueJs router-link not working, but link copied from it works in another tab

0👍

It seems that you are already using the props appid’ and ‘regid’ where the props are not yet fully ready in your component itself. Thats why the vue returned a warning.

You could put a condition first before you execute your vfor to ensure that the props has already a value. like this one

Regs.vue

 <template v-if="appid">
       <tr v-bind:key="index" v-for="(reg, index) in regs">
                <td class="masked">{{index+1}}</td>
                <td>{{reg.name}}</td>
                <td class="text-center">
                    <router-link class="bg-white" :to="{ name: 'ids', params: { appid: appid, 
                      regid: reg.id}}">
                        <i class="fa fa-border fa-eye" title="View Identities"/>
                    </router-link>
                </td>
       </tr>
</template>

Ids.vue

<template v-if="appid &&  regid">
    <tr v-bind:key="index" v-for="(id, index) in ids">
            <td class="masked">{{index+1}}</td>
            <td>{{id.name}}</td>
    </tr>
</template>

Leave a comment