File tree Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Expand file tree Collapse file tree 2 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 1177
1177
var this$1 = this ;
1178
1178
1179
1179
this . router = router
1180
- this . base = normalizeBae ( base )
1180
+ this . base = normalizeBase ( base )
1181
1181
// start with a route object that stands for "nowhere"
1182
1182
this . current = createRoute ( null , {
1183
1183
path : '__vue_router_init__'
1247
1247
} )
1248
1248
} ;
1249
1249
1250
- History . prototype . getLocation = function getLocation ( ) {
1251
- return '/'
1252
- } ;
1253
-
1254
- function normalizeBae ( base ) {
1250
+ function normalizeBase ( base ) {
1255
1251
if ( ! base ) {
1256
1252
if ( inBrowser ) {
1257
1253
// respect <base> tag
1480
1476
if ( base && path . indexOf ( base ) === 0 ) {
1481
1477
path = path . slice ( base . length )
1482
1478
}
1483
- return path + window . location . search + window . location . hash
1479
+ return ( path || '/' ) + window . location . search + window . location . hash
1484
1480
}
1485
1481
1486
1482
function pushState ( url , replace ) {
1513
1509
if ( fallback && this . checkFallback ( ) ) {
1514
1510
return
1515
1511
}
1512
+ ensureSlash ( )
1516
1513
window . addEventListener ( 'hashchange' , function ( ) {
1517
1514
this$1 . onHashChange ( )
1518
1515
} )
1523
1520
HashHistory . prototype . constructor = HashHistory ;
1524
1521
1525
1522
HashHistory . prototype . onInit = function onInit ( ) {
1526
- ensureSlash ( )
1527
1523
// possible redirect on start
1528
1524
if ( getHash ( ) !== this . current . fullPath ) {
1529
1525
replaceHash ( this . current . fullPath )
You can’t perform that action at this time.
0 commit comments