Skip to content

Commit 6659e44

Browse files
committed
#3258 fix
1 parent 9fe9e3e commit 6659e44

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/router/index.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,6 @@ 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-
}
405401
// This goes through the matched routes from last to first, finding the closest route with a title.
406402
// e.g., if we have `/some/deep/nested/route` and `/some`, `/deep`, and `/nested` have titles,
407403
// `/nested`'s will be chosen.
@@ -416,6 +412,11 @@ router.beforeEach((to, from, next) => {
416412
// Remove any stale meta tags from the document using the key attribute we set below.
417413
Array.from(document.querySelectorAll('[data-vue-router-controlled]'), (el) => el.parentNode.removeChild(el));
418414

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

0 commit comments

Comments
 (0)