buefy
Version:
Lightweight UI components for Vue.js (v3) based on Bulma
39 lines (37 loc) • 873 B
text/typescript
import { defineComponent, h as createElement } from 'vue'
export default defineComponent({
name: 'BSlotComponent',
props: {
component: {
type: Object,
required: true
},
name: {
type: String,
default: 'default'
},
scoped: {
type: Boolean
},
props: {
type: Object
},
tag: {
type: [String, Object],
default: 'div'
}
},
methods: {
refresh() {
this.$forceUpdate()
}
},
render() {
return createElement(this.tag, {},
this.component.$slots
? this.scoped
? this.component.$slots[this.name](this.props)
: this.component.$slots[this.name]()
: undefined)
}
})