mirror of
https://gitee.com/layui/layui.git
synced 2025-04-05 17:38:02 +08:00
feat(flow): 流加载支持"加载更多"按钮文案自定义 (#1965)
* feat(flow): 流加载支持"加载更多"按钮文案自定义 * docs(flow): 流加载支持"加载更多"按钮文案自定义 * docs(flow): 优化 moreText 选项介绍文案 * docs(flow): 更新文档 --------- Co-authored-by: huangzepeng <huangzepeng@excellence.com.cn> Co-authored-by: 贤心 <3277200+sentsim@users.noreply.github.com> Co-authored-by: morning-star <26325820+Sight-wcg@users.noreply.github.com>
This commit is contained in:
parent
7d86cc6206
commit
230b910c64
@ -50,6 +50,20 @@
|
|||||||
|
|
||||||
`true`
|
`true`
|
||||||
|
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>moreText</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
设置「加载更多」按钮的文本
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td>string</td>
|
||||||
|
<td>
|
||||||
|
|
||||||
|
<code style="font-size: 13px;">加载更多</code>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -19,6 +19,7 @@ layui.define('jquery', function(exports){
|
|||||||
var scrollElem = $(options.scrollElem || document); // 滚动条所在元素
|
var scrollElem = $(options.scrollElem || document); // 滚动条所在元素
|
||||||
var threshold = 'mb' in options ? options.mb : 50; // 临界距离
|
var threshold = 'mb' in options ? options.mb : 50; // 临界距离
|
||||||
var isAuto = 'isAuto' in options ? options.isAuto : true; // 否自动滚动加载
|
var isAuto = 'isAuto' in options ? options.isAuto : true; // 否自动滚动加载
|
||||||
|
var moreText = options.moreText || "加载更多"; // 手动加载时,加载更多按钮文案
|
||||||
var end = options.end || '没有更多了'; // “末页”显示文案
|
var end = options.end || '没有更多了'; // “末页”显示文案
|
||||||
var direction = options.direction || 'bottom';
|
var direction = options.direction || 'bottom';
|
||||||
var isTop = direction === 'top';
|
var isTop = direction === 'top';
|
||||||
@ -30,7 +31,7 @@ layui.define('jquery', function(exports){
|
|||||||
var notDocument = options.scrollElem && options.scrollElem !== document;
|
var notDocument = options.scrollElem && options.scrollElem !== document;
|
||||||
|
|
||||||
//加载更多
|
//加载更多
|
||||||
var ELEM_TEXT = '<cite>加载更多</cite>'
|
var ELEM_TEXT = '<cite>' + moreText + '</cite>'
|
||||||
,more = $('<div class="layui-flow-more"><a href="javascript:;">'+ ELEM_TEXT +'</a></div>');
|
,more = $('<div class="layui-flow-more"><a href="javascript:;">'+ ELEM_TEXT +'</a></div>');
|
||||||
|
|
||||||
if(!elem.find('.layui-flow-more')[0]){
|
if(!elem.find('.layui-flow-more')[0]){
|
||||||
|
Loading…
Reference in New Issue
Block a user