MUI 官网:https://www.dcloud.io/mui.html
MUI 文档:https://dev.dcloud.net.cn/mui/ui/
演示地址:https://dcloud.io/hellomui/ (支持手机和电脑浏览器)
开发工具:https://www.dcloud.io/hbuilderx.html (Hbuilder X)
上拉刷新、下拉加载相关 api 参考:
https://dev.dcloud.net.cn/mui/pulldown/
https://dev.dcloud.net.cn/mui/pullup/
项目中上拉和下拉跟 mui api中的调用方式有所不同,这里以项目中使用的方式为例:
1、首先页面增加样式:
<style>
html,
body {
background-color: #efeff4;
}
.mui-bar~.mui-content .mui-fullscreen {
top: 44px;
height: auto;
}
.mui-pull-top-tips {
position: absolute;
top: -20px;
left: 50%;
margin-left: -25px;
width: 40px;
height: 40px;
border-radius: 100%;
z-index: 1000;
}
.mui-bar~.mui-pull-top-tips {
top: 24px;
}
.mui-pull-top-wrapper {
width: 42px;
height: 42px;
display: block;
text-align: center;
background-color: #efeff4;
border: 1px solid #ddd;
border-radius: 25px;
background-clip: padding-box;
box-shadow: 0 4px 10px #bbb;
overflow: hidden;
}
.mui-pull-top-tips.mui-transitioning {
-webkit-transition-duration: 200ms;
transition-duration: 200ms;
}
.mui-pull-top-tips .mui-pull-loading {
/*-webkit-backface-visibility: hidden;
-webkit-transition-duration: 400ms;
transition-duration: 400ms;*/
margin: 0;
}
.mui-pull-top-wrapper .mui-icon,
.mui-pull-top-wrapper .mui-spinner {
margin-top: 7px;
}
.mui-pull-top-wrapper .mui-icon.mui-reverse {
/*-webkit-transform: rotate(180deg) translateZ(0);*/
}
.mui-pull-bottom-tips {
text-align: center;
background-color: #efeff4;
font-size: 15px;
line-height: 40px;
color: #777;
margin-bottom: 100px;/** 显示加载提示信息: 没有更多数据了等等。 */
}
.mui-pull-top-canvas {
overflow: hidden;
background-color: #fafafa;
border-radius: 40px;
box-shadow: 0 4px 10px #bbb;
width: 40px;
height: 40px;
margin: 0 auto;
}
.mui-pull-top-canvas canvas {
width: 40px;
}
.mui-slider-indicator.mui-segmented-control {
background-color: #efeff4;
}
</

本文介绍如何使用mui框架实现移动端应用的上拉刷新与下拉加载功能,包括必要的样式设置、JS文件引入及具体的业务实现代码。通过详细步骤说明帮助开发者快速掌握实现技巧。
最低0.47元/天 解锁文章
966

被折叠的 条评论
为什么被折叠?



