11import $ from 'dom7' ;
22import { document } from 'ssr-window' ;
33import Utils from '../../utils/utils' ;
4+ import Device from '../../utils/device' ;
45import History from '../../utils/history' ;
56import redirect from './redirect' ;
67import preRoute from './pre-route' ;
@@ -198,9 +199,11 @@ function backward(el, backwardOptions) {
198199 }
199200
200201 // History State
201- if ( router . params . pushState && options . pushState ) {
202- if ( backIndex ) History . go ( - backIndex ) ;
203- else History . back ( ) ;
202+ if ( ! ( Device . ie || Device . edge ) ) {
203+ if ( router . params . pushState && options . pushState ) {
204+ if ( backIndex ) History . go ( - backIndex ) ;
205+ else History . back ( ) ;
206+ }
204207 }
205208
206209 // Update History
@@ -221,6 +224,14 @@ function backward(el, backwardOptions) {
221224 // Current Route
222225 router . currentRoute = options . route ;
223226
227+ // History State
228+ if ( Device . ie || Device . edge ) {
229+ if ( router . params . pushState && options . pushState ) {
230+ if ( backIndex ) History . go ( - backIndex ) ;
231+ else History . back ( ) ;
232+ }
233+ }
234+
224235 // Insert Page
225236 insertPage ( ) ;
226237
@@ -274,7 +285,7 @@ function backward(el, backwardOptions) {
274285
275286 // Preload previous page
276287 const preloadPreviousPage = app . theme === 'ios' ? ( router . params . preloadPreviousPage || router . params . iosSwipeBack ) : router . params . preloadPreviousPage ;
277- if ( preloadPreviousPage ) {
288+ if ( preloadPreviousPage && router . history [ router . history . length - 2 ] ) {
278289 router . back ( router . history [ router . history . length - 2 ] , { preload : true } ) ;
279290 }
280291 if ( router . params . pushState ) {
0 commit comments