在Element UI的el-table组件中,默认情况下,当使用sortable属性进行排序时,空值(如null、undefined或空字符串"")会被视为普通数据进行排序,这可能会导致排序结果不符合预期。为了排除空值对排序的影响,你可以通过自定义排序函数来实现。 以下是针对你的问题,分点进行的详细解答: 确认el-table的sortable属性行为: el-...
<el-table v-loading="loading" :data="dataList" :defalut-sort="sortRule" @sort-change="sortChange"> <el-table-column :label="utilsTranslate('Project ID')" align="center" prop="projectID" sortable /> const sortRule = reactive({ prop: null, order: null}) const tabData = ref('') ...
*/exportconsttableSortChange= (tableData=[], column={}) => {// console.log('--tableSortChange--', tableData, column)if(column.order!==null) {letdata = [];letempData = [];//把空值和有值分两端放,table组件就可以处理排序了tableData.forEach((item, i) =>{if(item[column.prop]) {...
Element Plus Version:2.8.0 Browser / OS:UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Build Tool:Vite Reproduction Related Component el-table Reproduction Link ...
Issue Remove Inactive [Component] [table] el-table 空值会影响sortable #27794 Sign in to view logs Summary Jobs issue-remove-inactive Run details Usage Workflow file Triggered via issue September 2, 2024 08:31 tolking commented on #17978 3f08421 Status Success ...
Issue Remove Inactive [Component] [table] el-table 空值会影响sortable #27535 Sign in to view logs Summary Jobs issue-remove-inactive Run details Usage Workflow file Triggered via issue August 24, 2024 05:57 kooriookami commented on #17978 569013d Status Success ...
[Component] [table] el-table 空值会影响sortable #27802 Sign in to view logs Summary Jobs issue-remove-inactive Run details Usage Workflow file Triggered via issue September 2, 2024 09:52 ilylx commented on #17978 3a37320 Status Success Total duration 13s Artifacts – issue-remove...