Skip to content

Commit bf23741

Browse files
authored
Merge pull request #3288 from CVEProject/jd-3258-dev
#3258 browser tab shows record id (dev)
2 parents e1322c0 + d8e3ada commit bf23741

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/components/cveRecordSearchModule.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ function startSearch() {
157157
}
158158
} else {
159159
const lookupPath = `/CVERecord?id=${cveId}`;
160-
router.push(lookupPath)
160+
161+
router.push({path: lookupPath, query: {id: cveId}})
161162
}
162163
}
163164

src/router/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,11 @@ router.beforeEach((to, from, next) => {
418418
// If a route with a title was found, set the document (page) title to that value.
419419
if (nearestWithTitle) document.title = nearestWithTitle.meta.title;
420420

421+
//Changes title to reflect CVE-ID
422+
if (to.name === "CVERecord") {
423+
document.title = to.query.id + " | CVE"
424+
}
425+
421426
// Remove any stale meta tags from the document using the key attribute we set below.
422427
Array.from(document.querySelectorAll('[data-vue-router-controlled]'), (el) => el.parentNode.removeChild(el));
423428

@@ -434,7 +439,7 @@ router.beforeEach((to, from, next) => {
434439

435440
// We use this to track which meta tags we create so we don't interfere with other ones.
436441
tag.setAttribute('data-vue-router-controlled', '');
437-
442+
438443
return tag;
439444
})
440445
// Add the meta tags to the document head.

0 commit comments

Comments
 (0)