在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ vue 報錯:Cannot read property 'toLowerCase

vue 報錯: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>

點擊頁數(shù)修改時,或者每頁顯示條數(shù) 都會報如下錯誤

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

怎么修改這個錯誤?

回答
編輯回答
久舊酒

分頁沒有問題,錯誤在size-change事件里你的代碼

2017年5月12日 05:25
編輯回答
短嘆

因為你在handleSizeChange的函數(shù)中調(diào)用了字符串的方法,toLowerCase,但是你拿到的值是undefined,它沒有字符串方法。

2017年5月29日 17:52