diff --git a/src/history/base.js b/src/history/base.js index 7228061d3..7b002a40f 100644 --- a/src/history/base.js +++ b/src/history/base.js @@ -188,11 +188,14 @@ export class History { } function normalizeBase (base: ?string): string { + // respect tag if (!base) { if (inBrowser) { // respect tag - const baseEl = document.querySelector('base') - base = (baseEl && baseEl.getAttribute('href')) || '/' + const baseURI = document.baseURI || '/' + const a = document.createElement('a') + a.href = baseURI + base = a.pathname } else { base = '/' }