Skip to content

Commit

Permalink
feat(infiniteloading、scroller): 加载中文案 props 提取 jd-opensource#662 (jd-…
Browse files Browse the repository at this point in the history
…opensource#719)

* 优化加载中的文案

* docs: 优化可灵活配置加载中的文案
  • Loading branch information
lzzwoniu authored Oct 14, 2021
1 parent bcaab0f commit 8717244
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/packages/infiniteloading/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export default {
| use-window | 将滚动侦听器添加到 window 否则侦听组件的父节点 | Boolean | true
| use-capture | 是否使用捕获模式 true捕获 false冒泡 | Boolean | false
| unload-more-txt | 没有更多数据展示文案 | String | 哎呀,这里是底部了啦'
| loading-txt | 加载中自定义文案配置 | String | 加载中...'
| container-id | 在use-window属性为false的时候,自定义设置节点ID | String | ''

## Slot
Expand Down
6 changes: 5 additions & 1 deletion src/packages/infiniteloading/infiniteloading.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="load-more">
<div class="bottom-tips" v-if="isShowBottomTips">
<template v-if="isLoading">
<template v-if="!slotLoading"> <i class="loading-hint"></i><span class="loading-txt">加载中...</span> </template>
<template v-if="!slotLoading"> <i class="loading-hint"></i><span class="loading-txt">{{loadingTxt}}</span> </template>
<slot name="loading" v-else></slot>
</template>

Expand Down Expand Up @@ -52,6 +52,10 @@ export default {
type: String,
default: '哎呀,这里是底部了啦'
},
loadingTxt: {
type: String,
default: '加载中...'
},
scrollChange: {
type: Function
},
Expand Down
1 change: 1 addition & 0 deletions src/packages/scroller/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export default {
| threshold | 距离底部多少开始加载 | Number | 100
| pulldownTxt | 下拉展示文案 | String | '下拉刷新'
| loadMoreTxt | 上拉展示文案 | String | '上拉加载'
| loadingTxt | 加载中展示文案 | String | '加载中...'
| unloadMoreTxt | 没有更多数据展示文案 | String | '没有更多了'
| scrollTo | 滚动到指定位置,只能设置负数,需要配合scrollToCbk使用 | Number | 1

Expand Down
5 changes: 5 additions & 0 deletions src/packages/scroller/scroller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
:threshold="threshold"
:pulldown-txt="pulldownTxt"
:load-more-txt="loadMoreTxt"
:loading-txt="loadingTxt"
:unload-more-txt="unloadMoreTxt"
:props-time="propsTime"
:scroll-to="scrollTo"
Expand Down Expand Up @@ -62,6 +63,10 @@ export default {
type: String,
default: '上拉加载'
},
loadingTxt: {
type: String,
default: '加载中...'
},
unloadMoreTxt: {
type: String,
default: '没有更多了'
Expand Down
9 changes: 7 additions & 2 deletions src/packages/scroller/vertical-scroll.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
<div class="nut-vert-pulldown-txt" v-if="!isLoading">{{ pulldownTxt }}</div>
<div class="nut-vert-pulldown-status" v-else>
<span class="nut-vert-loading"></span>
<span class="nut-vert-loading-txt">加载中...</span>
<!-- <span class="nut-vert-loading-txt">加载中...</span> -->
<span class="nut-vert-loading-txt">{{loadingTxt}}</span>
</div>
</div>
<slot name="list"></slot>
Expand All @@ -14,7 +15,7 @@
<!-- <div class="nut-vert-load-txt" >{{loadMoreTxt}}</div> -->
<div class="nut-vert-load-status" v-if="isLoading">
<span class="nut-vert-loading"></span>
<span class="nut-vert-loading-txt">加载中...</span>
<span class="nut-vert-loading-txt">{{loadingTxt}}</span>
</div>
</template>
<template v-else-if="isUnMore">
Expand Down Expand Up @@ -48,6 +49,10 @@ export default {
type: String,
default: '上拉加载'
},
loadingTxt: {
type: String,
default: '加载中...'
},
unloadMoreTxt: {
type: String,
default: '没有更多了'
Expand Down

0 comments on commit 8717244

Please sign in to comment.