From 90de31719b1cc129fdf2681ac053863547a02f09 Mon Sep 17 00:00:00 2001 From: sunxiaobin89 <285584806@qq.com> Date: Fri, 28 Apr 2023 16:33:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20table=20`autoSort`=20?= =?UTF-8?q?=E4=B8=BA=20true=20=E5=B9=B6=E4=B8=94=E6=98=AF=20=E9=9D=99?= =?UTF-8?q?=E6=80=81=E6=95=B0=E6=8D=AE=20`data`=20=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E4=B8=8B=E6=9B=B4=E6=96=B0cache=E4=BF=A1=E6=81=AF=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E5=BD=B1=E5=93=8D=20`data`=20=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/table.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/table.js b/src/modules/table.js index 3dbd74e1..f82f6ea1 100644 --- a/src/modules/table.js +++ b/src/modules/table.js @@ -1530,11 +1530,11 @@ layui.define(['lay', 'laytpl', 'laypage', 'form', 'util'], function(exports){ // 默认为前端自动排序。如果否,则需自主排序(通常为服务端处理好排序) if(options.autoSort){ if(opts.type === 'asc'){ //升序 - thisData = layui.sort(data, field); + thisData = layui.sort(data, field, null, true); } else if(opts.type === 'desc'){ //降序 - thisData = layui.sort(data, field, true); + thisData = layui.sort(data, field, true, true); } else { // 清除排序 - thisData = layui.sort(data, table.config.indexName); + thisData = layui.sort(data, table.config.indexName, null, true); delete that.sortKey; delete options.initSort; }