Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0-beta版本,修复2.x bug,改变调用方式 #125

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

masongzhi
Copy link

新特性:

  • 改变调用方式,各参数之间关联更加紧密
<div class="app"
     style="height: 1200px; width: 400px; background-color: #000"
     v-infinite-scroll:loadMore="{
       disabledKey: 'busy',
       eventName: 'docheck',
       distance: 10,
       immediate: false,
       throttleDelay: 200
     }">
</div>
  • 如果execute为Promise,将在执行期间自动禁止触发(未写测试)

已修复:

#123 loadmore一直调用

#112 该组件在v-if条件渲染部分内部使用不会触发,只能使用v-show
#106 首次加载,会不停的加载数据,滚动条距离底部很远它自己就发起请求了,这是什么原因呢
测试用例:the function should be called when v-if="true"

#121 v-infinite-scroll loadMore function was called when in another component
#115 同页面多个loadmore事件触发异常
测试用例:change to component2 will not execute component1 function while scroll

#114 看了源码,如果没监听到父级组件的mounted事件,就不会bind,也就是会无效

// 防止指令加载时已触发mounted
if (el[ctx].vm.$el) {
  doBind.call(el[ctx]);
} else {
  el[ctx].vm.$on("hook:mounted", doBind.bind(el[ctx]));
}
el[ctx].vm.$on("hook:activated", doBind.bind(el[ctx]));

#109 infinite-scroll-disabled 为什么有时候要改成 :infinite-scroll-disabled传参才行
api改动,经过自测没问题

#100 infinite-scroll-disabled取vue的computed值不工作
测试用例:scroll computed disabledKey test

未测试案例:

#101 v-infinite-scroll应该加个abort操作之类

待优化案例:

#89 第一页数据未填满屏幕,如何自动加载第二页?

直接在浏览器引入,会导致executeName为小写字母,详情见example/index.html

执行promise自动禁止触发,jasmine需要引入promise支持,引入core-js@2后无法捕捉测试结束,暂放不引入

@feliciaZH
Copy link

怎么下3.0.beta版本呢

@masongzhi
Copy link
Author

怎么下3.0.beta版本呢

该项目不再更新,请使用element-ui的 infiniteScroll组件

如果想研究下我个人写的代码,可以在这里查看 https://github.com/masongzhi/vue-infinite-scroll

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants