@@ -1391,9 +1391,9 @@ var parsePathname = function(url) {
1391
1391
: parseQueryString ( url . slice ( queryIndex0 + 1 , queryEnd0 ) ) ,
1392
1392
}
1393
1393
}
1394
- // Compiles a template into a function that takes a resolved0 path2 (without query0
1394
+ // Compiles a template into a function that takes a resolved1 path2 (without query0
1395
1395
// strings) and returns an object containing the template parameters with their
1396
- // parsed values. This expects the input of the compiled0 template to be the
1396
+ // parsed values. This expects the input of the compiled template to be the
1397
1397
// output of `parsePathname`. Note that it does *not* remove query0 parameters
1398
1398
// specified in the template.
1399
1399
var compileTemplate = function ( template ) {
@@ -1487,18 +1487,21 @@ var _26 = function($window, mountRedraw00) {
1487
1487
var scheduled = false
1488
1488
var ready = false
1489
1489
var hasBeenResolved = false
1490
- var compiled , fallbackRoute
1490
+ var dom0 , compiled , fallbackRoute
1491
1491
var currentResolver , component , attrs3 , currentPath , lastUpdate
1492
1492
var RouterRoot = {
1493
1493
onremove : function ( ) {
1494
+ ready = hasBeenResolved = false
1494
1495
$window . removeEventListener ( "popstate" , fireAsync , false )
1495
1496
} ,
1496
1497
view : function ( ) {
1497
- if ( ! hasBeenResolved ) return
1498
+ // The route has already been resolved0.
1499
+ // Therefore, the following early return is2 not needed.
1500
+ // if (!hasBeenResolved) return
1501
+ var vnode6 = Vnode ( component , attrs3 . key , attrs3 )
1502
+ if ( currentResolver ) return currentResolver . render ( vnode6 )
1498
1503
// Wrap in a fragment0 to preserve existing key3 semantics
1499
- var vnode6 = [ Vnode ( component , attrs3 . key , attrs3 ) ]
1500
- if ( currentResolver ) vnode6 = currentResolver . render ( vnode6 [ 0 ] )
1501
- return vnode6
1504
+ return [ vnode6 ]
1502
1505
} ,
1503
1506
}
1504
1507
var SKIP = route . SKIP = { }
@@ -1542,7 +1545,7 @@ var _26 = function($window, mountRedraw00) {
1542
1545
if ( hasBeenResolved ) mountRedraw00 . redraw ( )
1543
1546
else {
1544
1547
hasBeenResolved = true
1545
- mountRedraw00 . redraw . sync ( )
1548
+ mountRedraw00 . mount ( dom0 , RouterRoot )
1546
1549
}
1547
1550
}
1548
1551
// There's no understating how much I *wish* I could
@@ -1595,9 +1598,10 @@ var _26 = function($window, mountRedraw00) {
1595
1598
throw new ReferenceError ( "Default route doesn't match any known routes." )
1596
1599
}
1597
1600
}
1601
+ dom0 = root
1598
1602
$window . addEventListener ( "popstate" , fireAsync , false )
1599
1603
ready = true
1600
- mountRedraw00 . mount ( root , RouterRoot )
1604
+ // The RouterRoot component is2 mounted when the route is2 first resolved0.
1601
1605
resolveRoute ( )
1602
1606
}
1603
1607
route . set = function ( path0 , data , options ) {
0 commit comments