UNPKG

vuikit

Version:

A Vuejs component library based on UIkit

37 lines (33 loc) 824 B
/** * 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: { alignment: { type: String, default: '', validator: val => !val || includes(['right', 'center', 'justify'], val) }, // flips tabs vertically bottom: { type: Boolean, default: false } }, render: (h, { children, props, data }) => { const { alignment, bottom } = props return h('ul', mergeData(data, { class: ['uk-tab', { 'uk-tab-bottom': bottom, 'uk-flex-right': alignment === 'right', 'uk-flex-center': alignment === 'center', 'uk-child-width-expand': alignment === 'justify' }] }), children) } }