@ishitatsuyuki/oruga-next
Version:
UI components for Vue.js and CSS framework agnostic
27 lines (25 loc) • 588 B
text/typescript
import { DefineComponent, defineComponent, h } from 'vue'
export default defineComponent({
name: 'OSlotComponent',
props: {
component: {
type: Object,
required: true
},
name: {
type: String,
default: 'default'
},
props: {
type: Object
},
tag: {
type: String,
default: 'div'
}
},
render() {
const slot = (this.component as DefineComponent).$slots[this.name](this.props)
return h(this.tag, {}, slot)
}
})