Skip to content

TerryZ/v-page

dev
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

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

v-page

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

Examples and Documentation

Examples and documentation please visit below sites

Installation

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

npm i -S v-page

Include and install plugin in your main.js file

// add component in global scope as plugin
import { createApp } from 'vue'
import App from './app.vue'
import Page from 'v-page'

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

You also can use v-page in local component

<template>
  <page />
</template>

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

Usage

<template>
  <v-page
    v-model="pageNumber"
    :total-row="totalRow"
    @change="pageChange"
  />
</template>

<script setup>
import { ref } from 'vue'

const pageNumber = ref(3)
const totalRow = ref(100)
// respond for pagination change
function pageChange (data) {
  console.log(pInfo) // { pageNumber: 1, pageSize: 10 }
}
</script>