feat(tag): better behavior for tag with internal link
This commit is contained in:
parent
f06323ab2b
commit
fb39dc533c
1 changed files with 2 additions and 1 deletions
3
index.ts
3
index.ts
|
@ -3,7 +3,8 @@ function setupEvents() {
|
||||||
t.addEventListener("click", _ => {
|
t.addEventListener("click", _ => {
|
||||||
const link = t.getAttribute("data-href")
|
const link = t.getAttribute("data-href")
|
||||||
if (link === null || link === "") return
|
if (link === null || link === "") return
|
||||||
window.open(link)
|
if (!link.startsWith(window.location.origin) && link.startsWith("https://")) window.open(link)
|
||||||
|
else changePage(link)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue