Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
v-pagination-3
Advanced tools
Readme
Simple, generic and non-intrusive pagination component for Vue.js version 3.
npm install v-pagination-3
import the script:
import Pagination from 'v-pagination-3';
COMING SOON
Register the component globally or locally:
app.component('pagination', Pagination);
OR
...
components: {
Pagination
}
...
Declare the data property to be used in v-model
:
{
data() {
return {
page: 1
}
}
}
Declare the component:
<pagination v-model="page" :records="500" :per-page="25" @paginate="myCallback"/>
props:
records
number
required
number of recordsper-page
number
required
records per page.v-model
number
required
Reference to the current page. Can be updated via the UI or programmaticallyoptions
object
optional
:
chunk
number
max pages per chunk. Default: 10
chunksNavigation
string
Which method to use when navigating outside chunks boundries. Default: fixed
. Options are:
scroll
- the range of pages presented will incrementally change when navigating to a page outside the chunk (e.g 1-10 will become 2-11 once the user presses the next arrow to move to page 11).fixed
- navigation will occur between fixed chunks (e.g 1-10, 11-20, 21-30 etc.). Double arrows will be added to allow navigation to the beginning of the previous or next chunk.theme
string
CSS theme used for styling. Supported: bootstrap3
, bootstrap4
,bulma
. Default: bootstrap3
.format
boolean
Format numbers using a separating comma. Default: true
edgeNavigation
Show links to first and last pages. Default: false
template
Pass your own custom templatehideCount
hide the count text. Default false
texts
object
optional
count
total records text. It can consist of up to 3 parts, divided by |
.
Default: Showing {from} to {to} of {count} records|{count} records|One record
first
First page text. Default: First
last
last page text. Default: Last
{page}
and {pages}
as a placeholders.
E.g: Showing page {page} out of {pages}
The model you bound to the component will be automatically updated.
In addition, when a page is selected a custom paginate
event will be dispatched.
Listen to it on the component and run your callback (@paginate="myCallback($event)"
)
The simplest way to programmatically manipulate the page is to directly update your bound model.
In addition to that you can call the following methods using a ref
on you component:
setPage(page)
next()
prev()
nextChunk()
prevChunk()
All methods return true
if the page is legal and was thus set, or false
otherwise.
totalPages
totalChunks
currentChunk
You can easily build your own template by copying src/Pagination.vue
to your project as a starting point and modifying the contents to your needs.
Then notify the component of your custom template by passing it to the template
option.
import MyPagination from './MyPagination'
...
{
options: {
template: MyPagination
}
}
FAQs
Vue.js 3 pagination component
The npm package v-pagination-3 receives a total of 3,205 weekly downloads. As such, v-pagination-3 popularity was classified as popular.
We found that v-pagination-3 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.