diff --git a/docs/flow/detail/options.md b/docs/flow/detail/options.md index 5b245da2..efe46477 100644 --- a/docs/flow/detail/options.md +++ b/docs/flow/detail/options.md @@ -50,6 +50,20 @@ `true` + + + +moreText + + +设置「加载更多」按钮的文本 + + +string + + +加载更多 + diff --git a/src/modules/flow.js b/src/modules/flow.js index 4824306a..6128e27d 100644 --- a/src/modules/flow.js +++ b/src/modules/flow.js @@ -19,6 +19,7 @@ layui.define('jquery', function(exports){ var scrollElem = $(options.scrollElem || document); // 滚动条所在元素 var threshold = 'mb' in options ? options.mb : 50; // 临界距离 var isAuto = 'isAuto' in options ? options.isAuto : true; // 否自动滚动加载 + var moreText = options.moreText || "加载更多"; // 手动加载时,加载更多按钮文案 var end = options.end || '没有更多了'; // “末页”显示文案 var direction = options.direction || 'bottom'; var isTop = direction === 'top'; @@ -30,7 +31,7 @@ layui.define('jquery', function(exports){ var notDocument = options.scrollElem && options.scrollElem !== document; //加载更多 - var ELEM_TEXT = '加载更多' + var ELEM_TEXT = '' + moreText + '' ,more = $('
'+ ELEM_TEXT +'
'); if(!elem.find('.layui-flow-more')[0]){