mint-ui pull down不起作用及解决方案
<template>
<div style="min-height:200px">
<mt-loadmore :top-method="loadTop" @top-status-change="handleTopChange" @bottom-status-change="handleBottomChange" :bottom-method="loadBottom" :bottom-all-loaded="allLoaded" ref="loadmore"> <ul>
<li v-for="(item,index) in list">[{{index}}]{{ item.text }}</li>
</ul>
<div slot="top" class="mint-loadmore-top">
<span v-show="topStatus !== 'loading'" :class="{ 'rotate': topStatus === 'drop' }">↓</span>
<span v-show="topStatus === 'loading'">上拉加载中...</span>
</div>
<div slot="bottom" class="mint-loadmore-bottom">
<span v-show="bottomStatus !== 'loading'" :class="{ 'rotate': topStatus === 'drop' }">↑</span>
<span v-show="bottomStatus === 'loading'">下拉加载中...</span>
</div> </mt-loadmore>
</div>
</template> <script>
import axios from 'axios';
import * as _global from '../../plugs/global';
import TrendFun from '../../plugs/function';
import BUS from '../../plugs/bus.js';
import { Toast,Loadmore } from 'mint-ui'; let trendFun=new TrendFun(); //公共函数库
let __REQUEST=trendFun.__REQUEST();
let __URILIST=_global.default; export default {
name: 'app',
data(){
return{
allLoaded:false,
page:0,
list: [ ] }
},
created(){ //this.getList();
},
methods:{
handleTopChange:function(status) {
this.topStatus = status;
console.log("this.topStatus = status; "+ status);
}, handleBottomChange:function(status) {
this.bottomStatus = status;
console.log("this.bottomStatus = status; "+ status);
}, getList:function(page){ __REQUEST.bizParams={
"bankCardId":"" ,// 银行卡ID ----非必填,只有在专门查一个银行卡时传
"cardBizCode":"WITHOLDING",// 卡业务编码 默认卡(DEFAULT), 自动代扣卡(WITHOLDING) ----- 非必填,不填查所有的
"type":"" // 卡类型 0:查询所有卡 1:只查储蓄卡 2:只查信用卡 ----- 非必填
}
let request=__REQUEST;
axios.get(__URILIST[2], {
params:request
})
.then(response=>{
let res=response.data; //axios返回的数据是用response.data包括的,和jquery不一样
if(res.data){
let tmparry=[];
//console.log(res.data.debitList);
res.data.msgList.map((e,i)=>{
if(e.msgType==1 && i<=3){
tmparry.push(e);
} });
this.list = this.list.concat(tmparry);
//this.list.push(tmparry);
console.log(tmparry);
} })
.catch(function (error) {
console.log(error);
}); },
loadTop:function(){
console.log(this.page);
//默认是第三页,下拉刷新的时候获取第一页
//this.page=1;
this.getList(this.page);
this.$refs.loadmore.onTopLoaded(); //手动调用,组件定位
this.$refs.loadmore.onBottomLoaded();
console.log("上拉执行");
},
loadMore:function(){
console.log("loadMore"); },
loadBottom:function() {
console.log("下拉在执行");
this.page=this.page+1; console.log("this.page:"+this.page);
this.getList(this.page);
if(this.page==20){
this.allLoaded=true; //当所有数据 全部读取完成的时候 停止下拉读取数据
//this.$refs.loadmore.onBottomLoaded();
} } },
components: { }
}
</script>
##后来如下解决,在外层放一个 div,此div是整个屏幕的高
<div class="page-loadmore-wrapper" ref="wrapper" :style="{ height: wrapperHeight + 'px' }">
主要就是这个: <template>
<div class="page-loadmore-wrapper" ref="wrapper" :style="{ height: wrapperHeight + 'px' }">
<mt-loadmore :bottom-method="loadBottom" :bottom-all-loaded="allLoaded" :top-method="loadTop" @top-status-change="handleTopChange" ref="loadmore">
<ul>
<li v-for="(item,index) in list">[{{index}}]{{ item.name }}</li>
</ul> <ul>
<li v-for="(item,index) in list">[{{index}}]{{ item.name }}</li>
</ul>
<div slot="top" class="mint-loadmore-top">
<span v-show="topStatus !== 'loading'" :class="{ 'is-rotate': topStatus === 'drop' }">↓</span>
<span v-show="topStatus === 'loading'"><mt-spinner type="snake"></mt-spinner></span>
</div> <div slot="bottom" class="mint-loadmore-bottom">
<span v-show="bottomStatus !== 'loading'" :class="{ 'is-rotate': bottomStatus === 'drop' }">↑</span>
<span v-show="bottomStatus === 'loading'">
<mt-spinner type="snake"></mt-spinner>
</span>
</div> </mt-loadmore> </div>
</template> <script>
import axios from 'axios';
// import * as _global from '../../plugs/global';
// import TrendFun from '../../plugs/function';
// import BUS from '../../plugs/bus.js';
import { Toast,Indicator,Loadmore } from 'mint-ui'; // let trendFun=new TrendFun(); //公共函数库
// let __REQUEST=trendFun.__REQUEST();
// let __URILIST=_global.default; let __REQUEST={}; export default {
name: 'app',
data(){
return{
allLoaded:false,
page:0,
list: [
{
"name": ".gitignore1"
},
{
"name": ".gitignore"
},
{
"name": ".gitignore"
},
{
"name": ".gitignore"
},
{
"name": ".gitignore"
},
{
"name": ".gitignore"
},
{
"name": ".gitignore"
},
{
"name": ".gitignore"
},
{
"name": ".gitignore"
},
{
"name": ".gitignore"
},
{
"name": ".gitignore"
},
{
"name": ".gitignore"
},
{
"name": ".gitignore"
},
{
"name": ".gitignore"
},
{
"name": ".gitignore"
},
{
"name": ".gitignore"
},
{
"name": ".gitignore"
},
{
"name": ".gitignore"
},
{
"name": ".gitignore"
},
{
"name": ".gitignore100"
}
],
topStatus:'',
bottomStatus:'' ,
wrapperHeight: 0 }
},
mounted() {
this.wrapperHeight = document.documentElement.clientHeight - this.$refs.wrapper.getBoundingClientRect().top;
},
methods:{
handleTopChange:function(status) {
this.topStatus = status;
console.log("this.topStatus = status; "+ status);
}, handleBottomChange:function(status) {
this.bottomStatus = status;
console.log("this.bottomStatus = status; "+ status);
}, getList:function(page){ __REQUEST.bizParams={
"bankCardId":"" ,// 银行卡ID ----非必填,只有在专门查一个银行卡时传
"cardBizCode":"WITHOLDING",// 卡业务编码 默认卡(DEFAULT), 自动代扣卡(WITHOLDING) ----- 非必填,不填查所有的
"type":"" // 卡类型 0:查询所有卡 1:只查储蓄卡 2:只查信用卡 ----- 非必填
}
let request=__REQUEST;
axios.get('https://api.github.com/repos/typecho-fans/plugins/contents/', {
params:request
})
.then(response=>{
let res=response.data; //axios返回的数据是用response.data包括的,和jquery不一样
console.log();
if(res){
let tmparry=[];
//console.log(res.data.debitList);
res.map((e,i)=>{
if(i<=3){
tmparry.push(e);
} });
this.list = this.list.concat(tmparry);
//this.list.push(tmparry);
console.log(tmparry);
} })
.catch(function (error) {
console.log(error);
}); },
loadTop:function(){
console.log(this.page);
//默认是第三页,下拉刷新的时候获取第一页
//this.page=1;
this.getList(this.page);
this.$refs.loadmore.onTopLoaded(); //手动调用,组件定位 console.log("上拉执行");
},
loadMore:function(){
console.log("loadMore"); },
loadBottom:function() {
console.log("下拉在执行");
this.page=this.page+1;
this.$refs.loadmore.onBottomLoaded();
console.log("this.page:"+this.page);
this.getList(this.page);
if(this.page==5){
this.allLoaded=true; //当所有数据 全部读取完成的时候 停止下拉读取数据
} } },
components: { }
}
</script> <style>
.page-loadmore .mint-spinner {
display: inline-block;
vertical-align: middle
} .page-loadmore-desc {
text-align: center;
color: #666;
padding-bottom: 5px
} .page-loadmore-desc:last-of-type,.page-loadmore-listitem {
border-bottom: 1px solid #eee
} .page-loadmore-listitem {
height: 50px;
line-height: 50px;
text-align: center
} .page-loadmore-listitem:first-child {
border-top: 1px solid #eee
} .page-loadmore-wrapper {
margin-top: -1px;
overflow: scroll
} .loading-background {
width: 100%;
height: 50px;
line-height: 50px;
text-align: center
} .loading-background,.mint-loadmore-top span {
-webkit-transition: .2s linear;
transition: .2s linear
} .mint-loadmore-top span {
display: inline-block;
vertical-align: middle
} .mint-loadmore-top span.is-rotate {
-webkit-transform: rotate(180deg);
transform: rotate(180deg)
} .page-loadmore .mint-spinner {
display: inline-block;
vertical-align: middle
} .page-loadmore-desc {
text-align: center;
color: #666;
padding-bottom: 5px
} .page-loadmore-desc:last-of-type,.page-loadmore-listitem {
border-bottom: 1px solid #eee
} .page-loadmore-listitem {
height: 50px;
line-height: 50px;
text-align: center
} .page-loadmore-listitem:first-child {
border-top: 1px solid #eee
} .page-loadmore-wrapper {
overflow: scroll
} .mint-loadmore-bottom span {
display: inline-block;
-webkit-transition: .2s linear;
transition: .2s linear;
vertical-align: middle
} .mint-loadmore-bottom span.is-rotate {
-webkit-transform: rotate(180deg);
transform: rotate(180deg)
} </style>
mint-ui pull down不起作用及解决方案的更多相关文章
- 基于Mint UI和MUI开发VUE项目一之环境搭建和首页的实现
一:简介 Mint UI 包含丰富的 CSS 和 JS 组件,能够满足日常的移动端开发需要.通过它,可以快速构建出风格统一的页面,提升开发效率.真正意义上的按需加载组件.可以只加载声明过的组件及其样式 ...
- vue mint ui 手册文档对于墙的恐惧
http://www.cnblogs.com/smallteeth/p/6901610.html npm 安装 推荐使用 npm 的方式安装,它能更好地和 webpack 打包工具配合使用. npm ...
- vue mint ui 手册文档
npm 安装 推荐使用 npm 的方式安装,它能更好地和 webpack 打包工具配合使用. npm i mint-ui -S CDN 目前可以通过 unpkg.com/mint-ui 获取到最新版本 ...
- vue mint UI
vue 与mint UI 结合开发手机app html5页面 api 文档 http://mint-ui.github.io/#!/zh-cn
- vue mand-mobile ui加class不起作用的问题 css权重问题
vue mand-mobile ui加class不起作用的问题 css权重问题组件的样式优先权比自己定的class高多加几层权重才行,要直接用样式覆盖也可以在前面多加几层class,定位更精确了才会覆 ...
- 基于VUE.JS的移动端框架Mint UI
Mint UI GitHub:github.com/ElemeFE/mint 项目主页:mint-ui.github.io/# Demo:elemefe.github.io/mint- 文档:mint ...
- Mint UI文档
Mint UI文档:http://elemefe.github.io/mint-ui/#/ 一.Mint UI的安装和基本用法. 1.NPM :npm i mint-ui -S 建议使用npm进行安装 ...
- 新建一个基于vue.js+Mint UI的项目
上篇文章里面讲到如何新建一个基于vue,js的项目(详细文章请戳用Vue创建一个新的项目). 该项目如果需要组件等都需要自己去写,今天就学习一下如何新建一个基于vue.js+Mint UI的项目,直接 ...
- iView webapp / Mint UI / MUI [前端UI]
前端UI iView webapp一套高质量的 微信小程序 UI 组件库 https://weapp.iviewui.com/?from=iview Mint UI 基于 Vue.js 的移动端组件库 ...
随机推荐
- 值域线段树 (玲珑OJ 1117)
点击打开题目链接 题目意思很简单: 1.插入x 2.把小于x的数变成x 3.把大于x的数变成x 4.求集合中第x小数 5.求集合中小于x的数个数 思路: 线段树,节点是值的分数,你可以离散,也可以不离 ...
- shell---rpm
[root@master src]# rpm -qpl epel-release-latest-6.noarch.rpm ##查询该rpm包安装了什么warning: epel-rel ...
- springboot中使用@Value读取配置文件
一.配置文件配置 直接配置 在src/main/resources下添加配置文件application.properties 例如修改端口号 #端口号 server.port=8089 分环境配置 在 ...
- 转:CURL库在程序中的运用浅析
CURL库在程序中的运用浅析-nk_ysg-ChinaUnix博客 http://blog.chinaunix.net/uid-22476414-id-3286638.html 这个目录的文章转载fr ...
- java 内存管理机制
垃圾收集算法 1.标记清理算法:效率不高(标记和清理过程效率都不高).会形成内存碎片 2.复制算法:把内存分为两部分,当进行回收时,把使用部分的存活对象复制到未使用部分,然后两部分内存角色互换(一个为 ...
- android调试之adb
ADB 其实大部分的PC开发机与Android设备的操作都是通过adb(android debug bridge)技术完成的,这是一个C/S架构的命令行工具,主要由三个部分组成 运行在PC开发机上的命 ...
- ElasticSearch基础+文档CRUD操作
本篇博客是上一篇的延续,主要用来将年前学习ES的知识点做一个回顾,方便日后进行复习和汇总!因为近期项目中使用ES出现了点小问题,因此在这里做一个详细的汇总! [01]全文检索和Lucene (1)全文 ...
- PHP实用小程序(一)
<? //设置路径(默认当前php文件所在路径) $basedir = "d:/inetpub/wwwroot"; $textrows = "20"; $ ...
- (2)ASP.NET Core 依赖关系注入(服务)
1.前言 面向对象设计(OOD)里有一个重要的思想就是依赖倒置原则(DIP),并由该原则牵引出依赖注入(DI).控制反转(IOC)及其容器等老生常谈的概念,初学者很容易被这些概念搞晕(包括我在内),在 ...
- 洛谷 - P1381 - 单词背诵 - 哈希 - 尺取
https://www.luogu.org/problemnew/show/P1381 字符串匹配,用哈希总没有错的. 然后就是尺取了,题目要求首先尽可能多覆盖,那么每次尾巴往后面长. 一开始先找到第 ...