@@ -13,7 +13,7 @@ import {
1313 */
1414
1515export function canReuse ( view , handler , transition ) {
16- let component = view . childVM
16+ const component = view . childVM
1717 if ( ! component || ! handler ) {
1818 return false
1919 }
@@ -22,7 +22,7 @@ export function canReuse (view, handler, transition) {
2222 if ( view . Component !== handler . component ) {
2323 return false
2424 }
25- let canReuseFn = getRouteConfig ( component , 'canReuse' )
25+ const canReuseFn = getRouteConfig ( component , 'canReuse' )
2626 return typeof canReuseFn === 'boolean'
2727 ? canReuseFn
2828 : canReuseFn
@@ -41,8 +41,8 @@ export function canReuse (view, handler, transition) {
4141 */
4242
4343export function canDeactivate ( view , transition , next ) {
44- let fromComponent = view . childVM
45- let hook = getRouteConfig ( fromComponent , 'canDeactivate' )
44+ const fromComponent = view . childVM
45+ const hook = getRouteConfig ( fromComponent , 'canDeactivate' )
4646 if ( ! hook ) {
4747 next ( )
4848 } else {
@@ -67,7 +67,7 @@ export function canActivate (handler, transition, next) {
6767 return
6868 }
6969 // determine if this component can be activated
70- let hook = getRouteConfig ( Component , 'canActivate' )
70+ const hook = getRouteConfig ( Component , 'canActivate' )
7171 if ( ! hook ) {
7272 next ( )
7373 } else {
@@ -87,8 +87,8 @@ export function canActivate (handler, transition, next) {
8787 */
8888
8989export function deactivate ( view , transition , next ) {
90- let component = view . childVM
91- let hook = getRouteConfig ( component , 'deactivate' )
90+ const component = view . childVM
91+ const hook = getRouteConfig ( component , 'deactivate' )
9292 if ( ! hook ) {
9393 next ( )
9494 } else {
@@ -106,7 +106,7 @@ export function deactivate (view, transition, next) {
106106 */
107107
108108export function activate ( view , transition , depth , cb , reuse ) {
109- let handler = transition . activateQueue [ depth ]
109+ const handler = transition . activateQueue [ depth ]
110110 if ( ! handler ) {
111111 saveChildView ( view )
112112 if ( view . _bound ) {
@@ -116,16 +116,16 @@ export function activate (view, transition, depth, cb, reuse) {
116116 return
117117 }
118118
119- let Component = view . Component = handler . component
120- let activateHook = getRouteConfig ( Component , 'activate' )
121- let dataHook = getRouteConfig ( Component , 'data' )
122- let waitForData = getRouteConfig ( Component , 'waitForData' )
119+ const Component = view . Component = handler . component
120+ const activateHook = getRouteConfig ( Component , 'activate' )
121+ const dataHook = getRouteConfig ( Component , 'data' )
122+ const waitForData = getRouteConfig ( Component , 'waitForData' )
123123
124124 view . depth = depth
125125 view . activated = false
126126
127127 let component
128- let loading = ! ! ( dataHook && ! waitForData )
128+ const loading = ! ! ( dataHook && ! waitForData )
129129
130130 // "reuse" is a flag passed down when the parent view is
131131 // either reused via keep-alive or as a child of a kept-alive view.
@@ -162,7 +162,7 @@ export function activate (view, transition, depth, cb, reuse) {
162162 // and also properly update current view's child view.
163163 if ( view . keepAlive ) {
164164 component . $loadingRouteData = loading
165- let cachedChildView = component . _keepAliveRouterView
165+ const cachedChildView = component . _keepAliveRouterView
166166 if ( cachedChildView ) {
167167 view . childView = cachedChildView
168168 component . _keepAliveRouterView = null
@@ -172,17 +172,17 @@ export function activate (view, transition, depth, cb, reuse) {
172172
173173 // cleanup the component in case the transition is aborted
174174 // before the component is ever inserted.
175- let cleanup = ( ) => {
175+ const cleanup = ( ) => {
176176 component . $destroy ( )
177177 }
178178
179179 // actually insert the component and trigger transition
180- let insert = ( ) => {
180+ const insert = ( ) => {
181181 if ( reuse ) {
182182 cb && cb ( )
183183 return
184184 }
185- let router = transition . router
185+ const router = transition . router
186186 if ( router . _rendered || router . _transitionOnLoad ) {
187187 view . transition ( component )
188188 } else {
@@ -201,7 +201,7 @@ export function activate (view, transition, depth, cb, reuse) {
201201 }
202202
203203 // called after activation hook is resolved
204- let afterActivate = ( ) => {
204+ const afterActivate = ( ) => {
205205 view . activated = true
206206 // activate the child view
207207 if ( view . childView ) {
@@ -234,8 +234,8 @@ export function activate (view, transition, depth, cb, reuse) {
234234 */
235235
236236export function reuse ( view , transition ) {
237- let component = view . childVM
238- let dataHook = getRouteConfig ( component , 'data' )
237+ const component = view . childVM
238+ const dataHook = getRouteConfig ( component , 'data' )
239239 if ( dataHook ) {
240240 loadData ( component , transition , dataHook )
241241 }
@@ -266,10 +266,10 @@ function loadData (component, transition, hook, cb, cleanup) {
266266 } , Object . create ( null ) )
267267 }
268268 // handle promise sugar syntax
269- let promises = [ ]
269+ const promises = [ ]
270270 if ( isPlainObject ( data ) ) {
271271 Object . keys ( data ) . forEach ( key => {
272- let val = data [ key ]
272+ const val = data [ key ]
273273 if ( isPromise ( val ) ) {
274274 promises . push ( val . then ( resolvedVal => {
275275 component . $set ( key , resolvedVal )
@@ -312,7 +312,7 @@ function saveChildView (view) {
312312
313313/**
314314 * Check plain object.
315- *
315+ *
316316 * @param {* } val
317317 */
318318
0 commit comments