Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
576 views
in Technique[技术] by (71.8m points)

elementUI的page-sizes设置完无效


<el-pagination
 :handleSizeChange="handleSizeChange"
 :handleCurrentChange="handleCurrentChange"
 :current-page="currentPage"
 :page-sizes="[10, 20, 50, 100]"
 :total="totalData"
 layout="total, prev, pager, next, jumper"
>
</el-pagination>

image

<div>
 <el-pagination @size-change="handleSizeChange"
 @current-change="handleCurrentChange"
 :page-sizes="[20, 60, 100, 300]"
 layout="total, sizes, prev, pager, next, jumper"
 :total="total"
 />
</div>
"dependencies": {
  "axios": "^0.18.0",
 "babel-polyfill": "^6.26.0",
 "countup.js": "^1.9.3",
 "cross-env": "^6.0.3",
 "echarts": "^4.2.0-rc.2",
 "element-ui": "2.4.6",
 "file-saver": "^2.0.0-rc.4",
 "normalize.css": "^7.0.0",
 "nprogress": "^0.2.0",
 "v-charts": "^1.18.0",
 "vue": "^2.5.2",
 "vue-countup-v2": "^1.0.3",
 "vue-cropper": "^0.4.8",
 "vue-print-nb": "^1.0.3",
 "vue-qr": "^1.5.2",
 "vue-router": "^3.0.1",
 "vuex": "^3.0.1",
 "xlsx": "^0.14.0"
}
methods: {
handleSizeChange: function (pageSize) {
  let _this = this
 _this.pageSize = pageSize
  _this.handleCurrentChange(_this.currentPage)
  // console.log(' handleSizeChange == ', pageSize)
},
handleCurrentChange (currentPage) {
  let _this = this
 _this.currentPage = currentPage
  _this.currentChangePage(currentPage)
  // console.log('handleCurrentChange == ', currentPage)
},
currentChangePage: function (currentPage) {
  // console.log('currentChangePage == ', currentPage)
 let _this = this
 let dataPost = {
    data: {
      pageNum: currentPage,
 pageSize: _this.pageSize,
 // schoolId: '8',
 schoolId: _this.searchList.schoolId,
 trainDate: _this.searchList.trainDate,
 elasticType: _this.findDataType
 },
 success: _this.handlePageData
 }
  console.log('dataPost == ', dataPost)
  _this.getCourseData(dataPost)
}
}

引用了import elPagination from '@/components/elPagination'导致的,注释掉即可


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
<el-pagination
  @size-change="handleSizeChange"
  @current-change="handleCurrentChange"
  :current-page="currentPage4"
  :page-sizes="[100, 200, 300, 400]"
  :page-size="100"
  layout="total, sizes, prev, pager, next, jumper"
  :total="400">
</el-pagination>
handleSizeChange
handleCurrentChange
这没有吧,况且事件使用@绑定的

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.5k users

...