Explorar o código

state.href needs to be updated only in web mode without base

Shaun %!s(int64=2) %!d(string=hai) anos
pai
achega
07dd169619
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/index.js

+ 3 - 1
src/index.js

@@ -68,7 +68,9 @@ export default function (Alpine) {
     state.params = router.match(url)
   })
 
-  Alpine.nextTick(() => state.href = location.href)
+  Alpine.nextTick(() => {
+    if (state.mode === 'web' && !state.base) state.href = location.href
+  })
   window.addEventListener('popstate', () => state.href = location.href)
 
   function push (path, options = {}) {