Skip to content

Commit 481b48d

Browse files
authored
Merge pull request #3282 from CVEProject/jd-3258-browserTab
#3258 dynamically updates tab title to reflect searched cve record
2 parents f1dc818 + 564917a commit 481b48d

2 files changed

Lines changed: 6 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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,11 @@ router.beforeEach((to, from, next) => {
412412
// Remove any stale meta tags from the document using the key attribute we set below.
413413
Array.from(document.querySelectorAll('[data-vue-router-controlled]'), (el) => el.parentNode.removeChild(el));
414414

415+
//Changes title to reflect CVE-ID
416+
if (to.name === "CVERecord") {
417+
document.title = to.query.id + " | CVE"
418+
}
419+
415420
// Skip rendering meta tags if there are none.
416421
if (!nearestWithMeta) return next();
417422

0 commit comments

Comments
 (0)