vuikit
Version:
A Vuejs component library based on UIkit
40 lines (35 loc) • 935 B
JavaScript
/**
* Vuikit 0.7.0
* (c) 2018 Miljan Aleksic
* @license MIT
*/
import IconPrevious from './assets/icon-prev'
export default {
functional: true,
props: ['label', 'expand'],
render (h, { props, parent }) {
const { label, expand } = props
// if not rendered by VkPagination, return comment to mark the position
if (!(parent.$options && parent.$options._componentTag === 'vk-pagination')) {
return h('li', { attrs: { label, expand } }, 'first')
}
return h('li', {
class: {
'uk-disabled': parent.prevPage < 1,
'uk-margin-auto-right': expand !== undefined
}
}, [
h('a', {
on: { click: e => parent.$emit('update:page', 1) }
}, [
h('span', {
staticClass: 'uk-icon uk-pagination-prev',
class: {
'uk-margin-small-right': label
}
}, [ h(IconPrevious) ]),
label && label
])
])
}
}