diff --git a/src/components/tooltip/tooltip.js b/src/components/tooltip/tooltip.js index ef5babcb8b2..7b970234c3c 100644 --- a/src/components/tooltip/tooltip.js +++ b/src/components/tooltip/tooltip.js @@ -1,3 +1,44 @@ -import bTooltip from './tooltip.vue'; +import ToolTip from '../../utils/tooltip.class'; +import { warn } from '../../utils'; +import { toolpopMixin } from '../../mixins'; -export default bTooltip; +export default { + mixins: [ toolpopMixin ], + render(h) { + return h( + 'div', + { class: [ 'd-none' ], style: { display: 'none' }, attrs: { 'aria-hidden': true } }, + [ h('div', { ref: 'title' }, this.$slots.default) ] + ); + }, + data() { + return {}; + }, + props: { + title: { + type: String, + default: '' + }, + triggers: { + type: [String, Array], + default: 'hover focus' + }, + placement: { + type: String, + default: 'top' + } + }, + methods: { + createToolpop() { + // getTarget is in toolpop mixin + const target = this.getTarget(); + if (target) { + this._toolpop = new ToolTip(target, this.getConfig(), this.$root); + } else { + this._toolpop = null; + warn("b-tooltip: 'target' element not found!"); + } + return this._toolpop; + } + } +}; diff --git a/src/components/tooltip/tooltip.vue b/src/components/tooltip/tooltip.vue deleted file mode 100644 index fce8a5c12de..00000000000 --- a/src/components/tooltip/tooltip.vue +++ /dev/null @@ -1,46 +0,0 @@ - - -