vuikit
Version:
A Vuejs component library based on UIkit
42 lines (35 loc) • 683 B
JavaScript
/**
* Vuikit 0.7.0
* (c) 2018 Miljan Aleksic
* @license MIT
*/
import VkIcon from '../icon/icon'
import mergeData from 'vuikit/core/helpers/vue-data-merge'
export default {
functional: true,
props: {
active: {
type: Boolean,
default: false
},
label: {
type: String,
required: true
},
icon: {
type: String
}
},
render (h, { props, data }) {
const { active, label, icon } = props
return h('li', mergeData(data, { class: { 'uk-active': active } }), [
h('a', [
icon && h(VkIcon, {
class: 'uk-margin-small-right',
props: { icon }
}),
label
])
])
}
}