implemented routing from users table to profile page

This commit is contained in:
ajdj100
2023-10-10 10:23:28 -04:00
parent d1aa688d47
commit 8cf76c67b1
3 changed files with 12 additions and 6 deletions

View File

@@ -12,6 +12,11 @@ export default {
setup(props) {
console.log(props.link);
},
computed: {
currentRouteName() {
return this.$route.name;
}
}
}
</script>

View File

@@ -10,22 +10,22 @@ export default createRouter({
component: () => import('./views/home.vue'),
},
{
path: '/profile',
path: '/profile/:name',
name: 'profile',
component: () => import('./components/ProfilePage/profile.vue'),
children: [
{
path: '/home',
path: 'home',
name: 'personnel',
component: () => import('./components/ProfilePage/personnel.vue')
},
{
path: '/activityHistory',
path: 'activityHistory',
name: 'activityHistory',
component: () => import('./components/ProfilePage/activityHistory.vue')
},
{
path: '/shadowbox',
path: 'shadowbox',
name: 'shadowbox',
component: () => import('./components/ProfilePage/shadowbox.vue')
}

View File

@@ -72,7 +72,7 @@ export default {
newTable = newTable.filter(this.filterByUnit);
newTable = newTable.filter(this.filterByName);
return newTable;
}
},
}
}
@@ -154,7 +154,8 @@ export default {
</tr>
</thead>
<tbody id="tableBody">
<tr v-for="(item, index) in filteredTable">
<tr v-for="(item, index) in filteredTable"
v-on:click="$router.push({ path: `/profile/${item.member_name}/home` })">
<td>{{ item.member_name }}</td>
<td>{{ item.status }}</td>
<td>{{ item.rank }}</td>