Permalink
Browse files

perf(tooltip): convert template to render function (#1310)

* [tooltip] convert to render function

* Delete tooltip.vue
  • Loading branch information...
tmorehouse committed Nov 10, 2017
1 parent 1736eb9 commit c812cb0996993ceeea8e80a7f7084462a9929dac
Showing with 43 additions and 48 deletions.
  1. +43 −2 src/components/tooltip/tooltip.js
  2. +0 −46 src/components/tooltip/tooltip.vue
@@ -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;
}
}
};

This file was deleted.

Oops, something went wrong.

0 comments on commit c812cb0

Please sign in to comment.