Comments (15)
@Leopoldthecoder 你自己测试下,看看是不是因为padding-bottom的问题。我这边也不太肯定。我先关了issue。有需要帮忙的话再叫我。
from mint-loadmore.
@74sharlock demo 页在手机上也不能上拉?
from mint-loadmore.
@Leopoldthecoder demo页打不开 可能需要翻墙 我正在找解决办法 测试demo页 同时看看源码
[2016-06-13 18:24:06]
demo页可以上拉!已经测试过了。
from mint-loadmore.
<template>
<div class="page health-tips">
<section class="no-footer">
<mt-loadmore :bottom-method="loadBottom" :bottom-status.sync="bottomStatus" :bottom-distance="distance" :auto-fill="autoFill">
<div>
<div class="text-img-card" v-for="tip in tips" track-by="$index">
<div class="image" v-if="tip.image"><img :src="tip.image"></div>
<p class="content">{{{tip}}}</p>
</div>
</div>
</mt-loadmore>
</section>
</div>
</template>
<style>
section {
padding: 10px;
background: #f6f6f6;
}
.text-img-card {
padding: 10px;
background-color: #fff;
margin-bottom: 10px;
border-radius: 6px;
.image {
width: 100%;
img {
width: 100%;
}
}
.title {
height: 35px;
display: flex;
align-items: center;
font-size: 14px;
}
.content {
font-size: 14px;
color: #999;
}
}
</style>
<script type="text/babel">
export default {
data() {
return {
loadingData: false,
tips: [],
currentPage: 1,
lastPage: 1,
total: 1,
distance: 120,
bottomStatus: '',
autoFill: false
};
},
methods: {
loadBottom(id) {
setTimeout(() => {
for (let i = 1; i <= 10; i++) {
this.tips.push(i);
}
this.$broadcast('onBottomLoaded', id);
}, 1500);
}
},
route: {
data(transition) {
setTimeout(() => {
transition.next({
tips: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
});
}, 1500);
}
}
};
</script>
我试着用你贴出来的代码测试,只是删除了不相关的组件,以及改了调用接口的一些地方,route 的 data 和 loadBottom 仍然保持异步。在电脑和手机上都没问题😂,或者你用这份代码试试?
from mint-loadmore.
@Leopoldthecoder 十分感激!我再测试下吧。
from mint-loadmore.
@Leopoldthecoder 测了又测,一开始还是各种不行,后来我把总体样式去掉了。重新测试可以了。肯定是我的样式影响了插件。虽然没有找到具体原因但是终于有了方向。谢谢帮忙!接下来我逐步排查样式。等我找到原因再来回复。
from mint-loadmore.
@74sharlock 辛苦了
from mint-loadmore.
这边初步排查的结果是,如果loadmore或者loadmore父容器有个padding-bottom的话,上拉就会失效,我在demo页试了一下好像也是。
from mint-loadmore.
<template>
<div class="page health-tips">
<common-header></common-header>
<load-more :bottom-method="loadBottom" :bottom-status.sync="bottomStatus" :bottom-distance="distance" :auto-fill="autoFill">
<section class="no-footer">
<div>
<div class="text-img-card" v-for="tip in tips" v-link="{path: '/' + $route.pageData.modelName + '/' + $index+ '/' + tip.id}" track-by="$index">
<div class="image" v-if="tip.image"><img :src="tip.image"></div>
<div class="title">{{tip.title}}</div>
<p class="content">{{{tip.content}}}</p>
</div>
</div>
<toast type="loading" v-show="loadingData">数据加载中</toast>
</section>
</load-more>
</div>
</template>
我把模板修改了一下,把loadmore作为section的父容器,然后一切都好了。
问题成功解决。
虽然还是不清楚具体原因。
from mint-loadmore.
OK,padding-bottom 的问题我看看能不能修好
from mint-loadmore.
@Leopoldthecoder 上下拉取现在都已经正常了,完成了好几个需要拉取数据的功能,特意来赞下。👍
from mint-loadmore.
@74sharlock 谢谢。升到了 0.1.2 版,应该解决了 loadmore 父容器有 padding-bottom 时上拉失效的问题,你可以试试看。不过 loadmore 本身还是不要有 padding-bottom,否则滚动到底的时候“上拉加载”几个字就会露出来。
from mint-loadmore.
@Leopoldthecoder 是的,我发现了。我现在尽量避免这种情况。如果确实需要padding-bottom,我就想办法调整结构尽量加到祖先元素中去。
另外,使用vue-cli, 开发环境时可以把组件源码复制过来去掉style样式,引用index.css,然后引用这个组件,就可以在浏览器里面debug了。这样很有助于找到问题。npm安装的包里面只有一个build完成的js。
from mint-loadmore.
@Leopoldthecoder 原来0.1.2版可以直接引用源码了!这样就可以直接debug了啊!👍
不过样式部分貌似需要装一个loader。这是什么,scss?
[5分钟后]这还是less。
[6分钟后]这真的是less吗。less-loader编译出错
from mint-loadmore.
样式是用我们自己的一套基于 postCSS 的插件库(salad)写的
from mint-loadmore.
Related Issues (20)
- 触摸滚动很不流畅,不知道哪里跟demo不一样 HOT 6
- Work on desktop ? HOT 2
- 动态加载数据后不能上拉 HOT 2
- _h is not defined HOT 6
- Error when rendering component <mt-loadmore> HOT 1
- vue.common.js?6ef8:521 [Vue warn]: Error when rendering component <mt-loadmore>: HOT 1
- translate 的值不能写死 50px
- 滑动时带动父元素运动
- vue 2.1.10用不了 HOT 1
- loadmore里面的for循环会走多次 HOT 1
- iOS使用fastclick的情况下,下拉刷新会触发点击事件 HOT 10
- ReferenceError: _h is not defined HOT 9
- 初始化loadmore出现错误,哪里出现错误了 HOT 3
- IOS经常出现下拉多次,无法触发加载更多 HOT 1
- 手机下拉的时候出现卡顿,或者是上拉的时候也会卡顿
- mt-loadmore
- mt-loadmore 当第一次加载返回空数据的时候
- 上拉加载更多,不会出现转圈的等待动画,这个是需要自己写吗?
- 拉项目到本地,运行npm install报错
- 下拉加载更多无法触发下拉方法 也没有下拉效果 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mint-loadmore.