Pārlūkot izejas kodu

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

Shaun 2 gadi atpakaļ
vecāks
revīzija
07dd169619
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. 3 1
      src/index.js

+ 3 - 1
src/index.js

@@ -68,7 +68,9 @@ export default function (Alpine) {
     state.params = router.match(url)
     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)
   window.addEventListener('popstate', () => state.href = location.href)
 
 
   function push (path, options = {}) {
   function push (path, options = {}) {