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

辽宁工程建设工程信息网站网站开发微博

辽宁工程建设工程信息网站,网站开发微博,四川网站建设平台,网站设计第一步怎么做vue3-h5-table 介绍 适用于 vue3 ts 的 h5 移动端项目 table 组件 支持 左侧固定 滑动 每行点击回调 支持 指定列排序 链接 :https://github.com/duKD/vue3-h5-table 效果 props说明minTableHeight表格最小高度 可选 默认600rowNum表格显示几行 可选 默认 6he…

vue3-h5-table

介绍

适用于 vue3 + ts 的 h5 移动端项目 table 组件

支持 左侧固定 滑动 每行点击回调 支持 指定列排序

链接 :https://github.com/duKD/vue3-h5-table

效果

请添加图片描述

props说明
minTableHeight表格最小高度 可选 默认600
rowNum表格显示几行 可选 默认 6
headerHeight头部默认高度 可选 默认 60
rowHeight每行数据的默认高度 默认 100
column每列数据说明 见下文
tableDatas表格数据
fixedHeader是否固定表头 默认true
export type columnItemType = {title:string // 列名dataIndex?:string // table data key 值 width?:number // 列 宽度slotKey?:string // 插槽作用域 idsortable?:boolean //是否 支持排序align?: 'left'|'center'|'right' // 布局key?:string // 哪个列数据 作为 唯一key 值 默认 indexrender?:(h:renderType,row:any)=>void // 自定义render
}

使用 实例:

<template><div class="position"><h5-tableref="h5TableRef":fixed-header="true":column="column":table-datas="tableDatas"@row-click="rowClick"@handle-head-sort-click="handleHeadSortClick"><template #title="item"><section class="nameAndMarkValue"><div class="name">{{ item.select }}<span class="type">{{ item.type === 1 ? "深" : "沪" }}</span></div><div class="markValue">{{ item.markValue }}</div></section></template><template #positionAndUse="item"><section class="positionAndUse"><div class="position">{{ item.position }}</div><div class="use">{{ item.use }}</div></section></template><template #curAndCost="item"><section class="curAndCost"><div class="cur">{{ item.cur }}</div><div class="cost">{{ item.cost }}</div></section></template><template #floatAndProfit="item"><section class="floatAndProfit"><div class="float">{{ item.float }}</div><div class="profit">{{ item.profit }}</div></section></template><template #rowDownMark><sectionclass="rowDownMark":style="{top: cellSize(rowDownMarkTop),}"v-show="rowDownMarkTop > 0"><div class="rowDownMark-item" @click="handelSell">买入</div><div class="rowDownMark-item">卖出</div><div class="rowDownMark-item">行情</div></section></template></h5-table></div>
</template>
<script setup lang="ts">
import { H5Table } from "@/components/h5-table";
import type {columnItemType,sortStatusType,
} from "@/components/h5-table/types";
import { watchEffect, ref, watch } from "vue";
import { cellSize } from "@/components/h5-table/utils";const column: Array<columnItemType> = [{title: "班费/总值",key: "id",dataIndex: "nameAndMarkValue",width: 250,slotKey: "title",align: "left",},{title: "持仓/可用",slotKey: "positionAndUse",dataIndex: "positionAndUse",sortable: true,width: 200,align: "right",},{title: "现价/成本",slotKey: "curAndCost",dataIndex: "curAndCost",// sortable: true,width: 200,align: "right",},{title: "浮动/盈亏",width: 200,slotKey: "floatAndProfit",align: "right",},{title: "账户资产",dataIndex: "count",width: 200,},
];const datas = [{id: 0,select: "三年二班",type: 1,position: "27000",use: "5,000",markValue: "500,033.341",cur: "30.004",cost: "32.453",newPrice: 20,float: "+18,879.09",profit: "-5.45%",count: "120,121",},{id: 1,select: "四年一班",type: 1,markValue: "23,933.341",position: "28000",use: "5,000",newPrice: 20,cur: "30.004",cost: "32.453",float: "+18,879.09",profit: "-5.45%",count: "120,121",},{id: 2,select: "三年二班",markValue: "500,033,341",newPrice: 20,cur: "30.004",cost: "32.453",position: "27300",use: "5,000",float: "+18,879.09",profit: "-5.45%",count: "120,121",},{id: 3,select: "五年二班",markValue: "500,033,341",position: "27000",use: "5,000",cur: "30.004",cost: "32.453",newPrice: 20,float: "+18,879.09",profit: "-5.45%",count: "120,121",},{id: 4,select: "一年二班",markValue: "500,033,341",position: "27000",use: "5,000",newPrice: 20,cur: "30.004",cost: "32.453",float: "+18,879.09",profit: "-5.45%",count: "120,121",},{id: 5,select: "六年三班",markValue: "500,033,341",position: "37000",use: "5,000",newPrice: 20,cur: "30.004",cost: "32.453",float: "+18,879.09",profit: "-5.45%",count: "120,121",},{id: 6,select: "六年二班",markValue: "500,033,341",position: "37000",use: "5,000",newPrice: 20,cur: "30.004",cost: "32.453",float: "+18,879.09",profit: "-5.45%",count: "120,121",},{id: 7,select: "六年五班",markValue: "500,033,341",position: "37000",use: "5,000",newPrice: 20,cur: "30.004",cost: "32.453",float: "+18,879.09",profit: "-5.45%",count: "120,121",},
];const tableDatas = ref<Array<any>>(JSON.parse(JSON.stringify(datas)));const rowDownMarkTop = ref<number>(0);const h5TableRef = ref<typeof H5Table | null>(null);const rowClick = (item: any, index: number) => {rowDownMarkTop.value = (index + 1) * 100 + 60;if (h5TableRef.value) {h5TableRef.value.handleDom(60, index);}
};//处理排序
const handleHeadSortClick = (propsKey: string, type: sortStatusType) => {rowDownMarkTop.value = 0;if (h5TableRef.value) {h5TableRef.value.handleDom(60, -1);}if (type === 0) {tableDatas.value.splice(0, tableDatas.value.length, ...datas);return;}if (propsKey === "positionAndUse") {if (type === 1) {tableDatas.value.sort((a, b) => Number(b.position) - Number(a.position));} else {tableDatas.value.sort((a, b) => Number(a.position) - Number(b.position));}}
};watch(tableDatas.value, () => {console.log("watch====", tableDatas);
});const handelSell = () => {console.log("handelSell====");
};
</script>
<style>
body {padding: 0;margin: 0 !important;
}
</style>
<style lang="scss" scoped>
.position {font-size: 24px;.nameAndMarkValue {padding: 10px;.name {display: inline-block;position: relative;color: #222;font-size: 32px;.type {position: absolute;top: 50%;transform: translateY(-50%);right: -40px;display: inline-block;font-size: 24px;border: 1px solid #ff858d;padding: 0 4px;color: #ff858d;}}.markValue {color: #999;font-size: 24px;}}.positionAndUse {font-size: 28px;.position {color: #222;}.use {color: #999;}}.curAndCost {font-size: 28px;.cur {color: #222;}.cost {color: #999;}}.floatAndProfit {color: red;}.rowDownMark {position: absolute;width: 100%;display: flex;z-index: 99;height: 60px;background-color: #fcfcfc;align-items: center;.rowDownMark-item {flex-grow: 1;color: #309fea;text-align: center;}}
}
</style>

具体使用参考 github 项目中 app.vue 文件

http://www.yayakq.cn/news/466201/

相关文章:

  • 网络公司网站 优帮云乡林建设集团官方网站
  • discuz品牌空间网站一个网站做几个关键词
  • 最好网站开发公司电话wordpress 评论管理
  • 网站建设收费标准策划网站建设需多少钱
  • 做企业网站的费用挂什么科目云南seo网络优化师
  • 多网站建设永久免费云linux服务器网页
  • 公司内部网站设计石家庄新闻综合频道官网
  • 可以做秋招笔试题的网站优化师是做什么的
  • 烟台高端网站建设公司哪家好lnmp wordpress建设多网站
  • 建设部规范公布网站平面设计师需要学历
  • 站长工具seo综合查询怎么用网络营销网站建设方案
  • 上海到北京机票查询株洲新站seo
  • 宜宾网站开发经营购物网站
  • 网站建设技术中国十大摄影网站排名
  • 西安商城网站建设制作图片类网站开发需求
  • 做网站平台接单wordpress死链
  • 免费自己生成网站wordpress id重置
  • 门户网站制作费用青浦网站优化
  • 做网站官网好处seo搜索培训
  • 唯品会网站开发技术分析制作网页可以用
  • 网站建设突出特色汕头公司建站模板
  • 衙门口网站建设海外网络推广公司
  • 微网站 php一款app从开发到上线的流程
  • jquery网站后台山东房地产新闻
  • 整站优化方案wordpress 专业版主题
  • 微信做淘宝优惠券但网站是怎么建设但ui设计作品解析
  • 做网站尽在美橙互联wordpress自建站上可以买卖
  • 太湖县住房和城乡建设网站市建设局营销师资格证
  • 网站建设如何添加咨询关于征求网站建设的意见
  • 山东宏远建设有限公司网站网站后台管理系统进入