Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Nov 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
52 changes: 50 additions & 2 deletions src/components/popover/popover.js
@@ -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;
}
}
};
51 changes: 0 additions & 51 deletions src/components/popover/popover.vue

This file was deleted.