Skip to content

Commit

Permalink
fix(vue-app): remove hash from payload path (#7614)
Browse files Browse the repository at this point in the history
* fix(vue-app): remove hash from payload path

* test: add hash usage to full-static fixture
  • Loading branch information
pi0 committed Jun 26, 2020
1 parent a87218b commit a523853
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/vue-app/template/App.js
Expand Up @@ -295,7 +295,7 @@ export default {
if (base && route.startsWith(base)) {
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')
try {
const payload = await window.__NUXT_IMPORT__(decodeURI(route), encodeURI(src))
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/full-static/layouts/default.vue
Expand Up @@ -10,7 +10,7 @@
<NLink to="/pagination/1">
Pagination
</NLink>
<NLink to="/dynamic/foo bar">
<NLink to="/dynamic/foo bar#hash">
Dynamic route 1
</NLink>
<NLink to="/dynamic/foo%20bar">
Expand Down

0 comments on commit a523853

Please sign in to comment.