1.表格排序問(wèn)題:采用遠(yuǎn)程排序猾骡,sortable必須為custom透葛,否則會(huì)導(dǎo)致列表默認(rèn)排序。
<el-table-column v-for="(item,index) in customList[0]" width="" :label="item.name" align="center" :property="item.field + '_sum'" :sortable="item.sort == 1? 'custom' : false">
<template slot-scope="scope">
<span>{{ scope.row[item.field] ? scope.row[item.field] : scope.row[`${item.field}_sum`] }}</span>
</template>
</el-table-column>
2.el-pagination頁(yè)碼問(wèn)題:當(dāng)page首次綁定值為1時(shí)巡李,切換頁(yè)面后返回,此時(shí)page數(shù)據(jù)更新為2但試圖并未更新环凿。
解決辦法:采用v-if揍瑟,list數(shù)據(jù)未回來(lái)药蜻,視圖設(shè)置隱藏正压,list賦值成功后欣福,視圖設(shè)置顯示。
<div class="page-center" v-if="pageShow">
<el-pagination
class="page-cotent"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="listQuery.page"
:page-sizes="[ 20, 50, 100, 500 ]"
:page-size="listQuery.rows"
:total="listTotal"
hide-on-single-page
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</div>
2.el抽屜打開(kāi)自動(dòng)聚焦問(wèn)題焦履。
解決辦法:采用v-if拓劝。
watch: {
templateIndex(val) { //阻止抽屜出來(lái),抽屜內(nèi)自動(dòng)聚焦問(wèn)題
this.$nextTick(()=> {
this.tabShow = val? true : false
})
}
},