Permalink
Browse files

perf(popover): convert template to render function (#1311)

* [popover] convert to render function

* Delete popover.vue
  • Loading branch information...
tmorehouse committed Nov 10, 2017
1 parent c812cb0 commit de24eecd2139c88afc365235ad795f7b1818c93c
Showing with 50 additions and 53 deletions.
  1. +50 −2 src/components/popover/popover.js
  2. +0 −51 src/components/popover/popover.vue
@@ -1,3 +1,51 @@
import bPopover from './popover.vue';
import PopOver from '../../utils/popover.class';
import { warn } from '../../utils';
import { toolpopMixin } from '../../mixins';

export default bPopover;
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.title ),
h('div', { ref: 'content' }, this.$slots.default )
]
);
},
data() {
return {};
},
props: {
title: {
type: String,
default: ''
},
content: {
type: String,
default: ''
},
triggers: {
type: [String, Array],
default: 'click'
},
placement: {
type: String,
default: 'right'
}
},
methods: {
createToolpop() {
// getTarget is in toolpop mixin
const target = this.getTarget();
if (target) {
this._toolpop = new PopOver(target, this.getConfig(), this.$root);
} else {
this._toolpop = null;
warn("b-popover: 'target' element not found!");
}
return this._toolpop;
}
}
};

This file was deleted.

Oops, something went wrong.

0 comments on commit de24eec

Please sign in to comment.