80
80
</el-table-column >
81
81
</el-table >
82
82
83
- <div class =" pagination-container" >
84
- <el-pagination v-show =" total>0" :current-page =" listQuery.page" :page-sizes =" [10,20,30, 50]" :page-size =" listQuery.limit" :total =" total" background layout =" total, sizes, prev, pager, next, jumper" @size-change =" handleSizeChange" @current-change =" handleCurrentChange" />
85
- </div >
83
+ <pagination v-show =" total>0" :total =" total" :page.sync =" listQuery.page" :limit.sync =" listQuery.limit" @pagination =" getList" />
86
84
87
85
<el-dialog :title =" textMap[dialogStatus]" :visible.sync =" dialogFormVisible" >
88
86
<el-form ref =" dataForm" :rules =" rules" :model =" temp" label-position =" left" label-width =" 70px" style =" width : 400px ; margin-left :50px ;" >
130
128
131
129
<script >
132
130
import { fetchList , fetchPv , createArticle , updateArticle } from ' @/api/article'
133
- import waves from ' @/directive/waves' // 水波纹指令
131
+ import waves from ' @/directive/waves' // Waves directive
134
132
import { parseTime } from ' @/utils'
133
+ import Pagination from ' @/components/Pagination' // Secondary package based on el-pagination
135
134
136
135
const calendarTypeOptions = [
137
136
{ key: ' CN' , display_name: ' China' },
@@ -148,9 +147,8 @@ const calendarTypeKeyValue = calendarTypeOptions.reduce((acc, cur) => {
148
147
149
148
export default {
150
149
name: ' ComplexTable' ,
151
- directives: {
152
- waves
153
- },
150
+ components: { Pagination },
151
+ directives: { waves },
154
152
filters: {
155
153
statusFilter (status ) {
156
154
const statusMap = {
@@ -168,7 +166,7 @@ export default {
168
166
return {
169
167
tableKey: 0 ,
170
168
list: null ,
171
- total: null ,
169
+ total: 0 ,
172
170
listLoading: true ,
173
171
listQuery: {
174
172
page: 1 ,
@@ -228,14 +226,6 @@ export default {
228
226
this .listQuery .page = 1
229
227
this .getList ()
230
228
},
231
- handleSizeChange (val ) {
232
- this .listQuery .limit = val
233
- this .getList ()
234
- },
235
- handleCurrentChange (val ) {
236
- this .listQuery .page = val
237
- this .getList ()
238
- },
239
229
handleModifyStatus (row , status ) {
240
230
this .$message ({
241
231
message: ' 操作成功' ,
0 commit comments