@@ -63,6 +63,7 @@ import { toInteger } from '../../../utils/number'
6363import { keys } from '../../../utils/object'
6464import { warn } from '../../../utils/warn'
6565import { BvEvent } from '../../../utils/bv-event.class'
66+ import { listenOnRootMixin } from '../../../mixins/listen-on-root'
6667import { BVTooltipTemplate } from './bv-tooltip-template'
6768
6869// --- Constants ---
@@ -138,6 +139,7 @@ const templateData = {
138139// @vue /component
139140export const BVTooltip = /*#__PURE__*/ Vue . extend ( {
140141 name : NAME_TOOLTIP_HELPER ,
142+ mixins : [ listenOnRootMixin ] ,
141143 data ( ) {
142144 return {
143145 // BTooltip/BPopover/VBTooltip/VBPopover will update this data
@@ -681,14 +683,9 @@ export const BVTooltip = /*#__PURE__*/ Vue.extend({
681683 } )
682684 } ,
683685 emitEvent ( bvEvent ) {
684- // Emits a BvEvent on $root and this instance
685- const eventName = bvEvent . type
686- const $root = this . $root
687- if ( $root && $root . $emit ) {
688- // Emit an event on $root
689- $root . $emit ( getRootEventName ( this . templateType , eventName ) , bvEvent )
690- }
691- this . $emit ( eventName , bvEvent )
686+ const { type } = bvEvent
687+ this . emitOnRoot ( getRootEventName ( this . templateType , type ) , bvEvent )
688+ this . $emit ( type , bvEvent )
692689 } ,
693690 // --- Event handler setup methods ---
694691 listen ( ) {
0 commit comments