码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • 移动端表格分页uni-app


    使用uni-app提供的uni-table表格
    网址:https://uniapp.dcloud.net.cn/component/uniui/uni-table.html#%E4%BB%8B%E7%BB%8D

    <uni-table ref="table" :loading="loading" border stripe type="selection" emptyText="暂无更多数据"
    	@selection-change="selectionChange">
    		<uni-tr>
    			<uni-th width="100" align="center">资产名称uni-th>
    			<uni-th width="90" align="center">资产类别uni-th>
    			<uni-th width="80" align="center">原使用部门uni-th>
    			<uni-th width="50" align="center">操作uni-th>
    		uni-tr>
    		<uni-tr v-for="(item, index) in shenpilist" :key="index" :label="item.name" :name="item.name">
    			<uni-td align="center">{{ item.assetName }}uni-td>
    			<uni-td align="center">{{ item.categoryName }}uni-td>
    			<uni-td align="center">{{ item.deptName }}uni-td>
    			<uni-td align="center">
    				<button class="uni-button" size="mini" type="primary" @click="onModalState(item)">详情button>
    			uni-td>
    		uni-tr>
    	uni-table>
    <view class="uni-pagination-box"><uni-pagination show-icon  :current="queryParams.pageNum"
     :total="total" @change="change" />view>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    import {getAssets} from '@/api/subpkg/index.js'
    export default {
    		data() {
    			return {
    			// 列表数据
    			shenpilist: [],
    			// 参数列表
    			queryParams: {
    				pageNum: 1,
    				pageSize: 10,
    				category: undefined,
    				assetCode: '',
    				assetName: '',
    			},
    			total: null,//总数据
    			}
    		},
    		methods:{
    			async getAssets() {
    				const data = {
    					isForceAllocate: this.value.indexOf('是否强制调拨') !== -1 ? 1 : 0,
    					query: this.queryParams
    				}
    				const res = await getAssets(data)
    				uni.hideLoading()
    				this.shenpilist = res.rows
    				this.total = res.total; 
    				console.log(this.total);
    			},
    			// 分页触发
    			change(e) {
    			console.log(e.current);
    				this.queryParams.pageNum = e.current;
    				uni.showLoading({
    					title: '数据加载中',
    					mask: true,
    				});
    				//分页切换之后,在发一次请求,使数据更新
    				this.getAssets()
    			},
    		}
      }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42

    在这里插入图片描述

  • 相关阅读:
    使用 pm2 启动 nodejs 服务
    Vue如何实现单选、全选、反选
    LIO-SAM论文与代码阅读笔记(三)代码阅读:featureExtraction.cpp和mapOptmization.cpp
    Vue3通透教程【十七】Vite构建TS版本Vue项目
    关于nginx升级--存在0day漏洞
    LTD271次升级 | 网站/小程序可设访问IP的黑白名单 • 官微中心支持PDF等办公文件预览与并分享 • 订单退款显示更详尽明细
    如何实现安全密码历史记录
    【新媒体 | 自媒体 运营】虚拟素材(图片,字体,音频,视频)商用及CC版权相关问题
    05 图形学——图形渲染与颜色
    Java中的线程池的线程数量如何确定?
  • 原文地址:https://blog.csdn.net/weixin_59527403/article/details/134479774
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号