mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-03 15:28:14 +00:00
fix: nav event with spa off, anchor nav refresh page
This commit is contained in:
parent
173ec240d2
commit
952d6cb3dd
2 changed files with 1 additions and 5 deletions
quartz/components/scripts
|
@ -12,9 +12,6 @@ const isLocalUrl = (href: string) => {
|
|||
try {
|
||||
const url = new URL(href)
|
||||
if (window.location.origin === url.origin) {
|
||||
if (url.pathname === window.location.pathname) {
|
||||
return !url.hash
|
||||
}
|
||||
return true
|
||||
}
|
||||
} catch (e) {}
|
||||
|
@ -94,7 +91,6 @@ function createRouter() {
|
|||
window.addEventListener("click", async (event) => {
|
||||
const { url } = getOpts(event) ?? {}
|
||||
if (!url) return
|
||||
if (url.pathname === window.location.pathname) return
|
||||
event.preventDefault()
|
||||
try {
|
||||
navigate(url, false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue