自定义小程序Loading效果(vue.js移动端可用---需修改)

本文介绍如何在Vue.js移动端小程序中自定义加载更多效果,通过load-more组件展示三种不同的loading状态,并提供了在父页面goods-list中引入并使用load-more组件的详细步骤,包括组件的wxml、wxss、js文件以及goods-list的相关配置。
// load-more组件 (三种loading效果)

load-more.wxml

<view class="tui-loadmore-class tui-loadmore" wx:if="{
  
  {visible}}">
  <view class="{
  
  {'tui-loading-'+index}} {
  
  {(index==3 && type)?'tui-loading-'+type:''}}"></view>
  <view class="tui-loadmore-tips">{
  
  {text}}</view>
</view>

load-more.wxss

.tui-loadmore {
  width: 48%;
  margin: 1.5em auto;
  line-height: 1.5em;
  font-size: 24rpx;
  text-align: center;
}

.tui-loading-1 {
  margin: 0 5px;
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  -webkit-animation: a 1s steps(12) infinite;
  animation: a 1s steps(12) infinite;
  background: transparent url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHBhdGggZmlsb
<view class="next-tree-view-bottom" v-if="componentType == 'customer'"> <view class="next-tree-view-bottom-cancel" hover-class="hover-c" @tap="_cancel">取消</view> <view class="next-tree-view-bottom-confirm" hover-class="hover-c" @tap="_confirmBtn">确定</view> </view>.next-tree-view-bottom { min-height: 73px; /* 改为最小高度 */ height: auto; /* 自动撑开 */ background: #ffffff; z-index: 9999999999; display: flex; justify-content: center; // align-items: center; /* 垂直居中仍有效 */ gap: 12px; padding-left: 12px; padding-right: 12px; padding-top: 12px; padding-bottom: max(12px, calc(12px + env(safe-area-inset-bottom))); /* 安全区适配 */ box-sizing: border-box; } .next-tree-view-bottom-cancel, .next-tree-view-bottom-confirm { width: 45%; height: 50px; line-height: 50px; font-size: 18px; display: flex; justify-content: center; align-items: center; border-radius: 2px; } .next-tree-view-bottom-cancel { background: #ffffff; border: 1px solid #e5e5e5; color: #333333; } .next-tree-view-bottom-confirm { background: #0f56d5; color: #ffffff !important; /* 注意:!important 可能避免 */ }参考当前代码,帮我写一个小程序中使用的vue3组件,组件要求 1、吸底展示,宽默认是100vw,高度默认50px,外加底部安全距离,内边距默认是8px,12px,可通过入参自定义,背景色颜色默认#FFF 2、展示盒子内有一个或者多个按钮,按钮样式通过类型传入做设置,不传入类型则使用默认样式,每个按钮都会抛出自己的点击方法 3、可设置防抖和加载效果
最新发布
10-21
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值