0.0.1 • Published 7 years ago

wtbf-vue-page v0.0.1

Weekly downloads
5
License
-
Repository
-
Last release
7 years ago

wtbf-vue-page

This is yet another vue page component.

Install

Use npm to download code:

npm install wtbf-vue-page -S

then import it into your project, add below code into your main.js:

import Page from 'wtbf-vue-page'

Vue.use(Page)

Usage

<template>
<div class="demo">
  <div>
    <page :pageCount="pageCount"  :currentPage="currentPage" v-on:change="pagingChanged"></page>
  </div>
</div>
</template>


<script>
export default {
  data() {
    return {
      pageCount: 10,
      currentPage: 1
    }
  },
  methods: {
    pagingChanged(page) {
      page = page < 1 ? 1 : page
      this.currentPage = page
      this.reloadList()
    },
    reloadList() {
      console.log("data init")
    }
  },
}
</script>
0.0.1

7 years ago