vuikit
Version:
A Vuejs component library based on UIkit
28 lines (23 loc) • 540 B
JavaScript
/**
* Vuikit 0.7.0
* (c) 2018 Miljan Aleksic
* @license MIT
*/
import { includes } from 'vuikit/core/util'
import mergeData from 'vuikit/core/helpers/vue-data-merge'
export default {
functional: true,
props: {
type: {
type: String,
default: '',
validator: val => !val || includes(['success', 'warning', 'danger'], val)
}
},
render: (h, { data, props, children }) =>
h('span', mergeData(data, {
class: ['uk-label', {
[`uk-label-${props.type}`]: props.type
}]
}), children)
}