Skip to content

Commit

Permalink
docs: 更新 README.md 文档
Browse files Browse the repository at this point in the history
  • Loading branch information
TerryZ committed Aug 28, 2022
1 parent 54fd397 commit 8ea9c57
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 33 deletions.
60 changes: 28 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
# [v-page](https://terryz.github.io/vue/#/page) · [![circle ci](https://circleci.com/gh/TerryZ/v-page.svg?style=svg)](https://circleci.com/gh/TerryZ/v-page) [![code coverage](https://codecov.io/gh/TerryZ/v-page/branch/master/graph/badge.svg)](https://codecov.io/gh/TerryZ/v-page) [![npm version](https://img.shields.io/npm/v/v-page.svg)](https://www.npmjs.com/package/v-page) [![license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://mit-license.org/) [![npm download](https://img.shields.io/npm/dy/v-page.svg)](https://www.npmjs.com/package/v-page) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
# [v-page](https://terryz.github.io/vue/#/page) · [![CircleCI](https://dl.circleci.com/status-badge/img/gh/TerryZ/v-page/tree/master.svg?style=svg)](https://dl.circleci.com/status-badge/redirect/gh/TerryZ/v-page/tree/master) [![code coverage](https://codecov.io/gh/TerryZ/v-page/branch/master/graph/badge.svg)](https://codecov.io/gh/TerryZ/v-page) [![npm version](https://img.shields.io/npm/v/v-page.svg)](https://www.npmjs.com/package/v-page) [![license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://mit-license.org/) [![npm download](https://img.shields.io/npm/dy/v-page.svg)](https://www.npmjs.com/package/v-page) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

A simple pagination bar, including size Menu, i18n support, based on **Vue2**
A simple pagination bar for vue3, including size Menu, i18n support

<img src="https://terryz.github.io/image/v-page/v-page.png" alt="v-page" height="54px">

If you are using vue `2.x` version, please use [v-page 2.x](https://github.com/TerryZ/v-page/tree/dev-vue-2) version instead

## Examples and Documentation

Live Examples on [CodePen](https://codepen.io/terry05/pen/yjZYLR), more exmaples and documentation please visit below sites
Examples and documentation please visit below sites

- [English site](https://terryz.github.io/vue/#/page)
- [国内站点](https://terryz.gitee.io/vue/#/page)
- [github pages for english](https://terryz.github.io/vue/#/page)

The jQuery version: [bPage](https://github.com/TerryZ/bPage)

## Installation

<a href="https://nodei.co/npm/v-page/"><img src="https://nodei.co/npm/v-page.png"></a>
[![https://nodei.co/npm/v-page.png?downloads=true&downloadRank=true&stars=true](https://nodei.co/npm/v-page.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/v-page)

```sh
npm i -S v-page
```

Include and install plugin in your `main.js` file.
Include and install plugin in your `main.js` file

```js
// add component in global scope as plugin
import Vue from 'vue'
import { createApp } from 'vue'
import App from './app.vue'
import Page from 'v-page'
Vue.use(Page, {
global config options

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

You also can use `v-page` in local component

```vue
<template>
<v-page></v-page>
<page />
</template>
<script>
<script setup>
import { Page } from 'v-page'
export default {
components: {
'v-page': Page
}
}
</script>
```

Expand All @@ -54,24 +54,20 @@ export default {
```vue
<template>
<v-page
v-model="pageNumber"
:total-row="totalRow"
@page-change="pageChange"
></v-page>
@change="pageChange"
/>
</template>
<script>
export default {
data () {
return {
totalRow: 100 // required option
}
},
methods: {
// receive page info change callback
pageChange (pInfo) {
console.log(pInfo) // { pageNumber: 1, pageSize: 10 }
}
}
<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>
```
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"target": "es5",
"strict": true,
"module": "es2015",
"moduleResolution": "node"
"moduleResolution": "node",
"allowJs": true
}
}

0 comments on commit 8ea9c57

Please sign in to comment.