File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -153,10 +153,6 @@ export const BLink = /*#__PURE__*/ Vue.extend({
153153 const href = this . computedHref
154154 const isRouterLink = this . isRouterLink
155155
156- // We want to overwrite any click handler since our callback
157- // will invoke the user supplied handler9s) if !props.disabled
158- const handlers = { ...this . $listeners , click : this . onClick }
159-
160156 const componentData = {
161157 class : { active : this . active , disabled : this . disabled } ,
162158 attrs : {
@@ -170,9 +166,16 @@ export const BLink = /*#__PURE__*/ Vue.extend({
170166 : this . $attrs . tabindex ,
171167 'aria-disabled' : this . disabled ? 'true' : null
172168 } ,
173- props : this . computedProps ,
174- on : isRouterLink ? { } : handlers ,
175- nativeOn : isRouterLink ? handlers : { }
169+ props : this . computedProps
170+ }
171+ // Add the event handlers. We must use `navtiveOn` for
172+ // `<router-link>`/`<nuxt-link>` instead of `on`
173+ componentData [ isRouterLink ? 'nativeOn' : 'on' ] = {
174+ // Transfer all listeners (native) to the root element
175+ ...this . $listeners ,
176+ // We want to overwrite any click handler since our callback
177+ // will invoke the user supplied handler(s) if `!this.disabled`
178+ click : this . onClick
176179 }
177180
178181 // If href attribute exists on <router-link> (even undefined or null) it fails working on
You can’t perform that action at this time.
0 commit comments