Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
scc-net
netvs
netvs-core
Commits
1c7f700c
Commit
1c7f700c
authored
Oct 21, 2020
by
janis.streib
🦉
Browse files
ADD: dimple paginator component
parent
11aae70b
Changes
1
Show whitespace changes
Inline
Side-by-side
frontend/src/components/Paginator.vue
0 → 100644
View file @
1c7f700c
<
template
>
<div
class=
"paginator"
>
<b-pagination
:total-rows=
"items.length"
v-model=
"currentPage"
:per-page=
"items_per_page"
v-if=
"items && items.length > items_per_page"
>
</b-pagination>
<div
class=
"pagination_container"
>
<slot
name=
"content_skeleton_item"
v-if=
"items == null || items.length == 0"
></slot>
<slot
name=
"item"
v-else
v-for=
"item in items.slice((currentPage-1)*items_per_page, Math.min(items.length, currentPage*items_per_page))"
v-bind:item=
"item"
/>
</div>
<b-pagination
:total-rows=
"items.length"
v-model=
"currentPage"
:per-page=
"items_per_page"
v-if=
"items && items.length > items_per_page"
>
</b-pagination>
</div>
</
template
>
<
script
>
export
default
{
name
:
'
Paginator
'
,
data
()
{
return
{
currentPage
:
1
}
},
props
:
{
items
:
{
required
:
true
,
default
()
{
return
null
}
},
items_per_page
:
{
default
()
{
return
25
}
}
}
}
</
script
>
<
style
scoped
>
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment