当前位置: 首页 > news >正文

uniapp——展开和收起

案例展示

在这里插入图片描述
在这里插入图片描述

代码

后台返回的数据格式如下:

 {1: "大富科技速度快放假手动阀",2: "第三方斯蒂芬斯蒂芬是的开发时间",4: "45345345",5: "电饭锅电饭锅地方"
}
<view class="tipTitle">温馨提示</view>
<view class="tips"><block v-for="(tItem,tIndex) in common.config.warm_reminder_charing" :key="tIndex"><view v-if="tIndex<=tipNum">{{tIndex}}、{{tItem}}</view></block>
</view>
<view class="more" @click="look('open')" v-if="tipBtnShow">查看更多<image src="/static/images/downArrow.png" mode="aspectFill"></image>
</view>
<view class="more" @click="look('close')" v-if="!tipBtnShow">收起<image src="/static/images/downArrow.png" mode="aspectFill" style="transform: rotate(180deg);"></image>
</view>
.tipTitle {font-weight: bold;font-size: 28rpx;color: #3D3D3D;margin-top: 34rpx;
}.tips {padding: 18rpx 0 31rpx;font-size: 25rpx;color: #3D3D3D;border-bottom: 1rpx solid #DCDCDC;line-height: 35rpx;
}.more {display: flex;align-items: center;justify-content: center;font-size: 24rpx;color: #FE8300;margin-top: 22rpx;image {width: 20rpx;height: 11rpx;margin-left: 8rpx;}
}
data() {return {tipNum: 2, //默认显示1、2条数据tipBtnShow: true};
},
methods: {// 查看更多和收起look(e) {if (e == 'open') {//获取最后一个配置项的前缀let lastKey = Object.keys(this.common.config.warm_reminder_charing).pop();let lastPrefix = this.common.config.warm_reminder_charing[lastKey].substring(0, 1); // 获取前缀this.tipNum = lastPrefixthis.tipBtnShow = falsereturn}if (e == 'close') {this.tipNum = 2this.tipBtnShow = truereturn}}
}
http://www.lryc.cn/news/421146.html

相关文章:

  • WebGL2学习(2): GLSL ES 3.0
  • [大模型实战] DAMODEL云算力平台部署LLama3.1大语言模型
  • 驱动开发系列09 - Linux设备模型之设备,驱动和总线
  • HTML实现弹出层
  • Android控件详解
  • 记忆化搜索专题篇
  • 入网测评检查项大全(安全资料)
  • uni-app 开发App时调用uni-push 实现在线系统消息推送通知 保姆教程
  • 13.StringRedisTemplete使用
  • [工具]-gitee+pycharm-配置
  • 中间件是一种在客户端和服务器之间进行通信和处理的软件组件或服务
  • RCE-eval长度限制突破技巧
  • 【黑马】MyBatis
  • oracle创建dblink使得数据库A能够访问数据库B表LMEAS_MFG_FM的数据
  • git config 如何配置用户账户
  • SpringBoot基础(二):配置文件详解
  • Web安全(一)-靶场搭建过程-基于docker
  • 【JavaEE】单例模式和阻塞队列
  • RCE绕过技巧
  • Spring源码解析(31)之事务配置文件解析以及核心对象创建过程
  • win11安装docker报错记录
  • 【vulnhub】CLAMP 1.0.1靶机
  • GPS跟踪环路MATLAB之——数字锁相环
  • docker开发环境搭建-关于数据库的IP是什么
  • loginApi
  • 【RAG检索增强生成】Ollama+AnythingLLM本地搭建RAG大模型私有知识库
  • 【wiki知识库】08.添加用户登录功能--前端Vue部分修改
  • 写给非机器学习人员的 embedding 入门
  • Oracle【plsql编写九九乘法表】
  • ansible安装K8s