cubash-archive/legacyfrontend/src/assets/buefy/cjs/chunk-68eac4a7.js
2021-01-19 01:56:55 +11:00

54 lines
1.1 KiB
JavaScript

'use strict';
var helpers = require('./helpers.js');
var SlotComponent = {
name: 'BSlotComponent',
props: {
component: {
type: Object,
required: true
},
name: {
type: String,
default: 'default'
},
scoped: {
type: Boolean
},
props: {
type: Object
},
tag: {
type: String,
default: 'div'
},
event: {
type: String,
default: 'hook:updated'
}
},
methods: {
refresh: function refresh() {
this.$forceUpdate();
}
},
created: function created() {
if (helpers.isVueComponent(this.component)) {
this.component.$on(this.event, this.refresh);
}
},
beforeDestroy: function beforeDestroy() {
if (helpers.isVueComponent(this.component)) {
this.component.$off(this.event, this.refresh);
}
},
render: function render(createElement) {
if (helpers.isVueComponent(this.component)) {
return createElement(this.tag, {}, this.scoped ? this.component.$scopedSlots[this.name](this.props) : this.component.$slots[this.name]);
}
}
};
exports.SlotComponent = SlotComponent;