更新记录

1.0.0(2024-04-28)

  • 发布表格组件

平台兼容性

Vue2 Vue3
×
App 快应用 微信小程序 支付宝小程序 百度小程序 字节小程序 QQ小程序
HBuilderX 4.08 app-uvue × × × × × ×
钉钉小程序 快手小程序 飞书小程序 京东小程序
× × × ×
H5-Safari Android Browser 微信浏览器(Android) QQ浏览器(Android) Chrome IE Edge Firefox PC-Safari
× × × × ×

h-table

h-table(unix)组件库,一款适配 uni-app x 的轻量、简洁、高效、全面的移动端表格组件。

使用组件

引入组件后,可以在 页面 中直接使用组件

vue:

<template>
    <view class="listTitle">
        <text class="listText">普通表格</text>
    </view>
    <scroll-view class="scroll-view" direction="horizontal" scroll-x="true">
        <view class="box-pad">
            <h-table>
                <h-tr :head="true">
                    <h-td>流程</h-td>
                    <h-td :width="120">状态</h-td>
                    <h-td :width="120">计划开始</h-td>
                    <h-td :width="120">计划完成</h-td>
                </h-tr>
                <h-tr v-for="(item,index) in (list as List[])" :key="index">
                    <h-td>{{item.NodeLabel}}</h-td>
                    <h-td :width="120">
                        <text v-if="item.StatusName == '已完成'" class="text-cut success">{{item.StatusName}}</text>
                        <text v-else-if="item.StatusName == '处理中'" class="text-cut warning">{{item.StatusName}}</text>
                        <text v-else class="text-cut danger">{{item.StatusName}}</text>
                    </h-td>
                    <h-td :width="120">{{item.PlanEndDateStr}}</h-td>
                    <h-td :width="120">{{item.ActualEndDateStr}}</h-td>
                </h-tr>
            </h-table>
        </view>
    </scroll-view>
    <view class="listTitle">
        <text class="listText">斑马线</text>
    </view>
    <scroll-view class="scroll-view" direction="horizontal" scroll-x="true">
        <view class="box-pad">
            <h-table>
                <h-tr :head="true">
                    <h-td>流程</h-td>
                    <h-td :width="120">状态</h-td>
                    <h-td :width="120">计划开始</h-td>
                    <h-td :width="120">计划完成</h-td>
                </h-tr>
                <h-tr v-for="(item,index) in (list as List[])" :key="index" :class="index%2 == 1?'h-tr-zebra':''">
                    <h-td>{{item.NodeLabel}}</h-td>
                    <h-td :width="120">
                        <text v-if="item.StatusName == '已完成'" class="text-cut success">{{item.StatusName}}</text>
                        <text v-else-if="item.StatusName == '处理中'" class="text-cut warning">{{item.StatusName}}</text>
                        <text v-else class="text-cut danger">{{item.StatusName}}</text>
                    </h-td>
                    <h-td :width="120">{{item.PlanEndDateStr}}</h-td>
                    <h-td :width="120">{{item.ActualEndDateStr}}</h-td>
                </h-tr>
            </h-table>
        </view>
    </scroll-view>
</template>

TS:

type List = {
    NodeLabel : string;
    PlanEndDateStr : string;
    ActualEndDateStr : string;
    StatusName : string;
}
export default {
    data() {
        return {
            list: [{
                NodeLabel: '流程',
                PlanEndDateStr: '2024-02-01',
                ActualEndDateStr: '2024-02-02',
                StatusName: '已完成'
            }, {
                NodeLabel: '流程',
                PlanEndDateStr: '2024-02-01',
                ActualEndDateStr: '2024-02-02',
                StatusName: '处理中'
            }, {
                NodeLabel: '流程',
                PlanEndDateStr: '2024-02-01',
                ActualEndDateStr: '2024-02-02',
                StatusName: '未开始'
            }] as List[]
        }
    },
    () {

    },
    methods: {

    }
}

scss:

@import "@/uni_modules/h-table/components/h-table/h-table.scss"

隐私、权限声明

1. 本插件需要申请的系统权限列表:

2. 本插件采集的数据、发送的服务器地址、以及数据用途说明:

3. 本插件是否包含广告,如包含需详细说明广告表达方式、展示频率:

许可协议

MIT协议

暂无用户评论。

使用中有什么不明白的地方,就向插件作者提问吧~ 我要提问