diff --git a/src/components/PageStrcture/Nav.vue b/src/components/PageStrcture/Nav.vue index 09261b52..62bfc3eb 100644 --- a/src/components/PageStrcture/Nav.vue +++ b/src/components/PageStrcture/Nav.vue @@ -5,15 +5,23 @@ @click="navVisible = !navVisible" /> @@ -43,6 +51,16 @@ export default { return screenWidth && screenWidth < 600; }, isUrl: (str) => new RegExp(/(http|https):\/\/(\S+)(:[0-9]+)?/).test(str), + determineTarget(link) { + if (!link.target) return '_blank'; + switch (link.target) { + case 'sametab': return '_self'; + case 'newtab': return '_blank'; + case 'parent': return '_parent'; + case 'top': return '_top'; + default: return undefined; + } + }, }, };