Skip to content

Commit 9fe9e3e

Browse files
committed
#3258 dynamically updates tab title to reflect searched cve record
1 parent f1dc818 commit 9fe9e3e

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/components/cveRecordLookupModule.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export default {
131131
this.resetStates();
132132
useCveRecordLookupStore().cveId = this.cveId;
133133
const newPath = `/CVERecord?id=${useCveRecordLookupStore().cveId}`;
134-
this.$router.push(newPath);
134+
this.$router.push({path: newPath, query: {id: useCveRecordLookupStore().cveId }});
135135
this.lookupId()
136136
}
137137
},

src/router/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,10 @@ const router = createRouter({
398398

399399
// This callback runs before every route change, including on page load.
400400
router.beforeEach((to, from, next) => {
401+
//Changes title to reflect CVE-ID
402+
if (to.name === "CVERecord") {
403+
to.meta.title = to.query.id + "| CVE"
404+
}
401405
// This goes through the matched routes from last to first, finding the closest route with a title.
402406
// e.g., if we have `/some/deep/nested/route` and `/some`, `/deep`, and `/nested` have titles,
403407
// `/nested`'s will be chosen.

0 commit comments

Comments
 (0)