Vue reported an error: Cannot read property 'toLowerCase' of undefined "

<template>
  <div class="pagination">
    <el-row type="flex" justify="end" >
      <el-pagination
        background
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-sizes="pageSizes"
        :page-size="pageSize"
        :pager-count="5"
        layout="sizes, prev, pager, next, jumper"
        :total="total">
      </el-pagination>
    </el-row>
  </div>
</template>

when you click on the number of pages to modify, or the number of entries displayed on each page will report the following error

vue.esm.js?efeb:591 [Vue warn]: Error in event handler for "size-change": "TypeError: Cannot read property "toLowerCase" of undefined"

how do I correct this error?

Mar.16,2021
There is no problem with

paging. Your code


in the size-change event

because you called the string method in the function handleSizeChange , toLowerCase , but the value you get is undefined, which does not have a string method.


is my own problem in the size-change function, and the parameters are not passed correctly

Menu