一个基于Element的Vue2插件
npm install page-foot --save
或
cnpm insatll page-foot --save
- 基于element-ui 请保证项目中全局引入了element-ui
- 在main.js中添加
import PageFoot from 'page-foot'
Vue.use(PageFoot)
- 在Vue组件中使用
<template>
<div id="app">
<page-foot :pagination="pagination" @page-change="handleCurrentChange" ></page-foot>
</div>
</template>
<script>
export default {
name: 'app',
data: () => ({
pagination: {
current_page: 1,
per_page: 10,
total: 0
}
}),
methods: {
handleCurrentChange(val) {
console.log(val)
}
}
}
</script>
<style>
</style>
<page-foot :pagination="pagination" @page-change="handleCurrentChange"></page-foot>
<page-foot @play="play"></page-foot>
export default {
methods: {
handleCurrentChange(val) {
console.log('page change', val)
}
}