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) { setup(props) {
console.log(props.link); console.log(props.link);
}, },
computed: {
currentRouteName() {
return this.$route.name;
}
}
} }
</script> </script>

View File

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

View File

@@ -72,7 +72,7 @@ export default {
newTable = newTable.filter(this.filterByUnit); newTable = newTable.filter(this.filterByUnit);
newTable = newTable.filter(this.filterByName); newTable = newTable.filter(this.filterByName);
return newTable; return newTable;
} },
} }
} }
@@ -154,7 +154,8 @@ export default {
</tr> </tr>
</thead> </thead>
<tbody id="tableBody"> <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.member_name }}</td>
<td>{{ item.status }}</td> <td>{{ item.status }}</td>
<td>{{ item.rank }}</td> <td>{{ item.rank }}</td>