Pagnation.vue 873 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <template>
  2. <div>
  3. <el-pagination v-model:current-page="currentPage" :page-size="100" background layout="total, prev, pager, next"
  4. :total="1000" @size-change="handleSizeChange" @current-change="handleCurrentChange" />
  5. </div>
  6. </template>
  7. <script>
  8. import { ref, onMounted, watch, toRefs } from 'vue';
  9. import { ElMessage } from 'element-plus';
  10. export default {
  11. props: {
  12. },
  13. setup() {
  14. function reload() {
  15. }
  16. function handleSizeChange(e) {
  17. console.log(e, 'size');
  18. }
  19. function handleCurrentChange(e) {
  20. console.log(e, 'current');
  21. }
  22. onMounted(() => {
  23. reload()
  24. })
  25. return {
  26. reload,//初始化组件
  27. handleCurrentChange,
  28. handleSizeChange,
  29. }
  30. }
  31. }
  32. </script>
  33. <style lang="scss" scoped></style>