@@ -28,11 +28,12 @@ export default function (Vue) {
2828 // don't redirect on right click
2929 if ( e . button !== 0 ) return
3030
31+ let target = this . target
3132 if ( this . el . tagName === 'A' || e . target === this . el ) {
3233 // v-link on <a v-link="'path'">
3334 e . preventDefault ( )
34- if ( this . destination != null ) {
35- router . go ( this . destination , this . replace === true )
35+ if ( target != null ) {
36+ router . go ( target )
3637 }
3738 } else {
3839 // v-link delegate on <div v-link>
@@ -43,7 +44,11 @@ export default function (Vue) {
4344 if ( ! el || el . tagName !== 'A' || ! el . href ) return
4445 if ( sameOrigin ( el ) ) {
4546 e . preventDefault ( )
46- router . go ( el . pathname )
47+ router . go ( {
48+ path : el . pathname ,
49+ replace : target && target . replace ,
50+ append : target && target . append
51+ } )
4752 }
4853 }
4954 }
@@ -57,22 +62,23 @@ export default function (Vue) {
5762
5863 update ( path ) {
5964 let router = this . vm . $route . router
60- if ( typeof path === 'object' ) {
61- this . replace = path . replace
62- this . exact = path . exactMatch
65+ let append
66+ this . target = path
67+ if ( _ . isObject ( path ) ) {
68+ append = path . append
69+ this . exact = path . exact
6370 this . prevActiveClass = this . activeClass
6471 this . activeClass = path . activeClass
6572 }
66- path = router . _normalizePath ( path )
67- this . destination = path
73+ path = this . path = router . _stringifyPath ( path )
6874 this . activeRE = path && ! this . exact
6975 ? new RegExp ( '^' + path . replace ( regexEscapeRE , '\\$&' ) + '(\\b|$)' )
7076 : null
7177 this . updateClasses ( this . vm . $route . path )
7278 let isAbsolute = path . charAt ( 0 ) === '/'
7379 // do not format non-hash relative paths
7480 let href = router . mode === 'hash' || isAbsolute
75- ? router . history . formatPath ( path )
81+ ? router . history . formatPath ( path , append )
7682 : path
7783 if ( this . el . tagName === 'A' ) {
7884 if ( href ) {
@@ -85,7 +91,7 @@ export default function (Vue) {
8591
8692 updateClasses ( path ) {
8793 let el = this . el
88- let dest = this . destination
94+ let dest = this . path
8995 let router = this . vm . $route . router
9096 let activeClass = this . activeClass || router . _linkActiveClass
9197 // clear old class
0 commit comments