fix(vue-app): remove hash from payload path (#7614)

* fix(vue-app): remove hash from payload path

* test: add hash usage to full-static fixture
This commit is contained in:
pooya parsa 2020-06-26 17:10:24 +02:00 committed by GitHub
parent a87218b745
commit a52385361b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -295,7 +295,7 @@ export default {
if (base && route.startsWith(base)) { if (base && route.startsWith(base)) {
route = route.substr(base.length) route = route.substr(base.length)
} }
route = (route.replace(/\/+$/, '') || '/').split('?')[0] route = (route.replace(/\/+$/, '') || '/').split('?')[0].split('#')[0]
const src = urlJoin(base, staticAssetsBase, route, 'payload.js') const src = urlJoin(base, staticAssetsBase, route, 'payload.js')
try { try {
const payload = await window.__NUXT_IMPORT__(decodeURI(route), encodeURI(src)) const payload = await window.__NUXT_IMPORT__(decodeURI(route), encodeURI(src))

View File

@ -10,7 +10,7 @@
<NLink to="/pagination/1"> <NLink to="/pagination/1">
Pagination Pagination
</NLink> </NLink>
<NLink to="/dynamic/foo bar"> <NLink to="/dynamic/foo bar#hash">
Dynamic route 1 Dynamic route 1
</NLink> </NLink>
<NLink to="/dynamic/foo%20bar"> <NLink to="/dynamic/foo%20bar">