@@ -11,7 +11,7 @@ import { concat } from '../../utils/array'
1111import { attemptBlur , attemptFocus , isTag } from '../../utils/dom'
1212import { getRootEventName , stopEvent } from '../../utils/events'
1313import { isBoolean , isEvent , isFunction , isUndefined } from '../../utils/inspect'
14- import { sortKeys } from '../../utils/object'
14+ import { omit , sortKeys } from '../../utils/object'
1515import { makeProp , makePropsConfigurable , pluckProps } from '../../utils/props'
1616import { computeHref , computeRel , computeTag , isRouterLink } from '../../utils/router'
1717import { attrsMixin } from '../../mixins/attrs'
@@ -98,14 +98,18 @@ export const BLink = /*#__PURE__*/ Vue.extend({
9898 return computeHref ( { to, href } , this . computedTag )
9999 } ,
100100 computedProps ( ) {
101- const { prefetch } = this
101+ const { event , prefetch, routerTag } = this
102102 return this . isRouterLink
103103 ? {
104- ...pluckProps ( { ...routerLinkProps , ...nuxtLinkProps } , this ) ,
105- // Coerce `prefetch` value `null` to be `undefined`
106- prefetch : isBoolean ( prefetch ) ? prefetch : undefined ,
104+ ...pluckProps (
105+ omit ( { ...routerLinkProps , ...nuxtLinkProps } , [ 'event' , 'prefetch' , 'routerTag' ] ) ,
106+ this
107+ ) ,
108+ // Only add these props, when actually defined
109+ ...( event ? { event } : { } ) ,
110+ ...( isBoolean ( prefetch ) ? { prefetch } : { } ) ,
107111 // Pass `router-tag` as `tag` prop
108- tag : this . routerTag
112+ ... ( routerTag ? { tag : routerTag } : { } )
109113 }
110114 : { }
111115 } ,
0 commit comments