
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@vuesimple/vs-pagination
Advanced tools
A light weight vue plugin built with accessibility in mind.
Code Sandbox: Link
npm i @vuesimple/vs-pagination
<template>
<vs-pagination :total-pages="20" @change="changePage"></vs-pagination>
</template>
<script>
import VsPagination from '@vuesimple/vs-pagination';
export default {
components: {
VsPagination,
},
};
</script>
<script src="https://unpkg.com/@vuesimple/vs-pagination@<version>/dist/vs-pagination.min.js"></script>
// Main/Entry file
app.use(VsPagination.plugin);
<template>
<vs-pagination :total-pages="20" @change="changePage"></vs-pagination>
</template>
Nuxt Code Snippet
After installation,
Create a file /plugins/vs-pagination.js
import Vue from 'vue';
import VsPagination from '@vuesimple/vs-pagination';
Vue.component('vs-pagination', VsPagination);
Update nuxt.config.js
module.exports = {
...
plugins: [
{ src: '~plugins/vs-pagination', mode: 'client' }
...
]
}
In the page/ component
<template>
<vs-pagination :total-pages="20" @change="changePage"></vs-pagination>
</template>
Note
<no-ssr>...</no-ssr>
tag if you are facing ssr issues.import VsPagination from '@vuesimple/vs-pagination'
& add in component:{VsPagination}
and use it within component, without globally installing in plugin folder.Name | Type | Default | Description |
---|---|---|---|
total-pages | Number | - | Total count of pages. required |
current-page | Number | 1 | Sets the current page. |
page-padding | Number | 1 | Sets the number of pages that appear before and after active page between gap indicator. |
page-gap | Number | 2 | Positions the leading and trailing gap indicator, based on the current and total pages. |
hide-prev-next | Boolean | false | Hide prev and next button on reaching first or last page. |
Name | Description |
---|---|
change | On page change (return page value) |
You can define own arrow icon markup via slots:
Name | Description |
---|---|
leftIcon | Left Icon slot |
rightIcon | Right Icon slot |
FAQs
A simple vue pagination
The npm package @vuesimple/vs-pagination receives a total of 195 weekly downloads. As such, @vuesimple/vs-pagination popularity was classified as not popular.
We found that @vuesimple/vs-pagination demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.