UNPKG

sce-component

Version:

33 lines (29 loc) 675 B
export default { name: 's-card-media', functional: true, props: { overlayPosition: { type: String, default: 'bottom', validator: v => ['top', 'bottom', 'full'].includes(v) } }, render (h, ctx) { const data = ctx.data, cls = data.staticClass, slots = ctx.slots() let child = [slots.default] data.staticClass = `s-card-media relative-position${cls ? ` ${cls}` : ''}` if (slots.overlay) { child.push(h( 'div', { staticClass: `s-card-media-overlay absolute-${ctx.props.overlayPosition}` }, slots.overlay )) } return h('div', data, child) } }