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({
153
153
const href = this . computedHref
154
154
const isRouterLink = this . isRouterLink
155
155
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
-
160
156
const componentData = {
161
157
class : { active : this . active , disabled : this . disabled } ,
162
158
attrs : {
@@ -170,9 +166,16 @@ export const BLink = /*#__PURE__*/ Vue.extend({
170
166
: this . $attrs . tabindex ,
171
167
'aria-disabled' : this . disabled ? 'true' : null
172
168
} ,
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
176
179
}
177
180
178
181
// 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