File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ Router.install = function (Vue) {
23
23
24
24
// auto install
25
25
/* istanbul ignore if */
26
- if ( window . Vue ) {
26
+ if ( typeof window !== 'undefined' && window . Vue ) {
27
27
Router . install ( window . Vue )
28
28
}
29
29
Original file line number Diff line number Diff line change
1
+ var util = require ( '../util' )
1
2
var Recognizer = require ( 'route-recognizer' )
2
3
var historyBackends = {
3
4
abstract : require ( '../history/abstract' ) ,
@@ -64,7 +65,8 @@ function Router (options) {
64
65
this . _suppress = ! ! options . suppressTransitionError
65
66
66
67
// create history object
67
- this . mode = this . _abstract
68
+ var inBrowser = util . Vue . util . inBrowser
69
+ this . mode = ( ! inBrowser || this . _abstract )
68
70
? 'abstract'
69
71
: this . _history
70
72
? 'html5'
You can’t perform that action at this time.
0 commit comments