提交 066d64fc 编写于 作者: D dolymood

Merge branch 'dev' of github.com:didi/cube-ui into dev

...@@ -261,6 +261,9 @@ ...@@ -261,6 +261,9 @@
dirty && this.refresh() dirty && this.refresh()
} }
}, },
resetPullUpTxt() {
this.pullUpDirty = true
},
_calculateMinHeight() { _calculateMinHeight() {
if (this.$refs.listWrapper) { if (this.$refs.listWrapper) {
this.$refs.listWrapper.style.minHeight = this.pullDownRefresh || this.pullUpLoad ? `${getRect(this.$refs.wrapper).height + 1}px` : 0 this.$refs.listWrapper.style.minHeight = this.pullDownRefresh || this.pullUpLoad ? `${getRect(this.$refs.wrapper).height + 1}px` : 0
......
...@@ -168,7 +168,12 @@ describe('Scroll', () => { ...@@ -168,7 +168,12 @@ describe('Scroll', () => {
props: { props: {
data, data,
options: { options: {
pullUpLoad: true pullUpLoad: {
txt: {
more: 'more',
noMore: 'noMore'
}
}
} }
}, },
on: { on: {
...@@ -199,11 +204,21 @@ describe('Scroll', () => { ...@@ -199,11 +204,21 @@ describe('Scroll', () => {
// test: forceUpdate // test: forceUpdate
vm.forceUpdate() vm.forceUpdate()
setTimeout(() => { setTimeout(() => {
expect(vm.isPullUpLoad).to.be.false expect(vm.isPullUpLoad).to.be.false
expect(vm.pullUpDirty).to.be.false expect(vm.pullUpDirty).to.be.false
const pullUpTxtElm = vm.$el.querySelector('.cube-pullup-wrapper span')
expect(pullUpTxtElm.textContent).to.equal('noMore')
// test: resetPullUpTxt
vm.resetPullUpTxt()
vm.$nextTick(() => {
expect(pullUpTxtElm.textContent).to.equal('more')
done() done()
})
}, 50) }, 50)
}, 400) }, 400)
}, 150) }, 150)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册