sce-component
Version:
39 lines (35 loc) • 696 B
JavaScript
export default {
name: 'q-card',
functional: true,
props: {
square: Boolean,
flat: Boolean,
inline: Boolean,
color: String
},
render (h, ctx) {
const
data = ctx.data,
classes = data.staticClass,
prop = ctx.props
let cls = ['s-card']
if (prop.square) {
cls.push('no-border-radius')
}
if (prop.flat) {
cls.push('no-shadow')
}
if (prop.inline) {
cls.push('inline-block')
}
if (prop.color) {
cls.push(`bg-${prop.color} text-white s-card-dark`)
}
data.staticClass = `${cls.join(' ')}${classes ? ` ${classes}` : ''}`
return h(
'div',
data,
ctx.children
)
}
}