feat(tag): link
This commit is contained in:
parent
2621bc5978
commit
44173f34c2
4 changed files with 10 additions and 3 deletions
4
index.ts
4
index.ts
|
@ -1,7 +1,9 @@
|
|||
function setupEvents() {
|
||||
document.querySelectorAll<HTMLElement>(".tag")?.forEach(t => {
|
||||
t.addEventListener("click", _ => {
|
||||
// t.classList.toggle("active")
|
||||
const link = t.getAttribute("data-href")
|
||||
if (link === null || link === "") return
|
||||
window.open(link)
|
||||
})
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue