From 96f0621ff2a2d3b0db2610dce53510a7e20d1bb3 Mon Sep 17 00:00:00 2001 From: morning-star <1453017105@qq.com> Date: Wed, 6 Dec 2023 23:46:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20laypage=20countText=20?= =?UTF-8?q?=E9=80=89=E9=A1=B9=20(#1444)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/laypage/detail/options.md | 14 ++++++++++++++ src/modules/laypage.js | 5 ++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/laypage/detail/options.md b/docs/laypage/detail/options.md index 6c86d23c..85fabc96 100644 --- a/docs/laypage/detail/options.md +++ b/docs/laypage/detail/options.md @@ -200,6 +200,20 @@ limitTemplet: function(item) { skipText: ['Go to', '', 'Confirm'] ``` + +array +- + + +countText 2.9.1+ + + +用于自定义总数区域文本,如: + +``` +countText: ['Total ',''] +``` + array - diff --git a/src/modules/laypage.js b/src/modules/laypage.js index 4ce4af38..46b958c3 100644 --- a/src/modules/laypage.js +++ b/src/modules/laypage.js @@ -152,7 +152,10 @@ layui.define(function(exports){ }(), // 数据总数 - count: '共 '+ config.count +' 条', + count: function(){ + var countText = typeof config.countText === 'object' ? config.countText : ['共 ', ' 条']; + return ''+ countText[0] + config.count + countText[1] +'' + }(), // 每页条数 limit: function(){