Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
quasar-web-base
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nguyễn Hải Sơn
quasar-web-base
Commits
8178e236
Commit
8178e236
authored
Apr 27, 2021
by
Nguyễn Hải Sơn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pagination
parent
708e785c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
73 additions
and
0 deletions
+73
-0
index.vue
src/components/pagination/index.vue
+73
-0
No files found.
src/components/pagination/index.vue
0 → 100644
View file @
8178e236
<
template
>
<div
class=
"row items-center"
>
<q-space></q-space>
<span
class=
"q-mr-sm"
>
{{
$t
(
'recordPerPage'
)
}}
:
</span>
<q-select
:model-value=
"pageSize"
:options=
"pageSizeOptions"
emit-value
map-options
option-label=
"text"
option-value=
"value"
dense
hide-bottom-space
borderless
class=
"q-mr-md"
@
update:model-value=
"$emit('update:pageSize', $event)"
></q-select>
<q-pagination
:model-value=
"currentPage"
:max=
"totalPage"
direction-links
boundary-links
unelevated
@
update:model-value=
"$emit('update:currentPage', $event)"
/>
</div>
</
template
>
<
script
lang=
"ts"
>
import
{
defineComponent
,
PropType
}
from
'vue'
;
export
default
defineComponent
({
name
:
'PaginationComponent'
,
props
:
{
currentPage
:
{
type
:
Number
,
required
:
true
,
},
totalPage
:
{
type
:
Number
,
required
:
true
,
},
maxPages
:
{
type
:
Number
,
default
:
5
,
},
pageSize
:
{
type
:
Number
,
default
:
10
,
},
pageSizeOptions
:
{
type
:
Array
as
PropType
<
Array
<
{
value
:
number
;
text
:
string
|
number
;
}
>
>
,
default
:
()
=>
[
{
value
:
5
,
text
:
'5'
},
{
value
:
10
,
text
:
'10'
},
{
value
:
20
,
text
:
'20'
},
{
value
:
50
,
text
:
'50'
},
{
value
:
100
,
text
:
'100'
},
{
value
:
150
,
text
:
'150'
},
{
value
:
200
,
text
:
'200'
},
],
},
},
emits
:
[
'update:currentPage'
,
'update:pageSize'
],
setup
()
{
return
{};
},
});
</
script
>
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