Skip to content

Commit 59b6da3

Browse files
committedAug 6, 2019
fix(link): silence back navigations errors
1 parent 1381850 commit 59b6da3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/components/link.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { warn } from '../util/warn'
99
const toTypes: Array<Function> = [String, Object]
1010
const eventTypes: Array<Function> = [String, Array]
1111

12+
const noop = () => {}
13+
1214
export default {
1315
name: 'RouterLink',
1416
props: {
@@ -68,9 +70,9 @@ export default {
6870
const handler = e => {
6971
if (guardEvent(e)) {
7072
if (this.replace) {
71-
router.replace(location)
73+
router.replace(location, null, noop)
7274
} else {
73-
router.push(location)
75+
router.push(location, null, noop)
7476
}
7577
}
7678
}

1 commit comments

Comments
 (1)

crawn420 commented on Aug 7, 2019

@crawn420

url's param marking by ?param=x&... is abandoned when redirected using router3.1.1
url中用get方式标记的参数在不加目标路由(#/path)的情况下被删除了
eg: ) http://127.0.0.1:8008?system=XX&token=Ab3K7suZ0Oc2B5-lFm_yY&dbtype=CC
redirect to
http://127.0.0.1:8008/#/login

Please sign in to comment.