🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

v-page

Package Overview
Dependencies
Maintainers
0
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

v-page

A simple pagination bar

3.3.0
latest
Source
npm
Version published
Weekly downloads
416
-35.4%
Maintainers
0
Weekly downloads
 
Created
Source

v-page · CircleCI code coverage npm version license npm download JavaScript Style Guide

A simple pagination bar for vue3, including size Menu, i18n support features

v-page

If you are using vue 2.x version, please use v-page 2.x version instead

Examples and Documentation

Documentation and examples and please visit below sites

  • github-pages

Installation

https://nodei.co/npm/v-page.png?downloads=true&downloadRank=true&stars=true

# npm
npm i v-page
# yarn
yarn add v-page
# pnpm
pnpm add v-page

Include and install plugin in your main.js file

import { createApp } from 'vue'
import App from './app.vue'
import { PaginationBar } from 'v-page'

const app = createApp(App)
// install component globally
app.use(PaginationBar, {
  // globally config options
})
app.mount('#app')

Use v-page as a locally component

<template>
  <PaginationBar />
</template>

<script setup>
import { PaginationBar } from 'v-page'
</script>

Usage

<template>
  <PaginationBar
    v-model="pageNumber"
    :total-row="totalRow"
    @change="paginationChange"
  >
    <PaginationPageSizeOptions />
    <PaginationInfo />
    <PaginationFirstPage />
    <PaginationPreviousPage />
    <PaginationPageNumbers />
    <PaginationNextPage />
    <PaginationLastPage />
  </PaginationBar>
</template>

<script setup lang='ts'>
import { ref } from 'vue'
import {
  PaginationBar,
  PaginationPageSizeOptions,
  PaginationInfo,
  PaginationPanel,
  PaginationPageNumbers,
  PaginationFirstPage,
  PaginationPreviousPage,
  PaginationNextPage,
  PaginationLastPage
} from 'v-page'
import type { PageInfo } from 'v-page'
// set default page to 3
const pageNumber = ref<number>(3)
const totalRow = ref<number>(100)
// respond for pagination change
function paginationChange (data: PageInfo): void {
  console.log(data) // { pageNumber: 1, pageSize: 10, totalPage: 10 }
}
</script>

Keywords

front-end

FAQs

Package last updated on 25 Dec 2024

Did you know?

Socket

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.

Install

Related posts