Skip to content

Commit 05a5f08

Browse files
JounQinyyx990803
authored andcommitted
support no fallback on browsers which do not support history API (vuejs#1512)
1 parent 07d41dd commit 05a5f08

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

flow/declarations.js

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ declare type AfterNavigationHook = (to: Route, from: Route) => any
3030
declare type RouterOptions = {
3131
routes?: Array<RouteConfig>;
3232
mode?: string;
33+
fallback?: boolean;
3334
base?: string;
3435
linkActiveClass?: string;
3536
parseQuery?: (query: string) => Object;

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default class VueRouter {
4242
this.matcher = createMatcher(options.routes || [], this)
4343

4444
let mode = options.mode || 'hash'
45-
this.fallback = mode === 'history' && !supportsPushState
45+
this.fallback = mode === 'history' && !supportsPushState && options.fallback !== false
4646
if (this.fallback) {
4747
mode = 'hash'
4848
}

0 commit comments

Comments
 (0)