更新记录

1.0.0(2022-12-26)

第一版提交


平台兼容性

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

lwt-table

仿 element-ui 的 el-table, 适用范围:h5、app-plus 因为小程序不支持自定义 render,所以暂不支持小程序

image

lwt-table 属性

属性 类型 默认值
data array []
customStyle object {}

可以通过 customStyle 给表格一个固定高度 即可产生上下滚动,否则默认根据内容撑开

lwt-column 属性

属性 类型 默认值
label string ''
prop string ''
width number 0 单位默认 px
fixed true/'left'/'right' false
align 'left'/'center'/'right' 'center'

用法

<template>
  <lwt-table :data="table" :custom-style="{ height: '300px' }">
    <lwt-column label="月份" prop="month" fixed :width="80" />
    <lwt-column label="成本合计" prop="total" />
    <lwt-column label="公司成本" prop="value" />
    <lwt-column label="项目成本" prop="value1" />
    <lwt-column label="项目地址" prop="addr" fixed="right" width="200">
      <view slot-scope="{ row }" style="color: red">
        {{ row.addr || "--" }}
      </view>
    </lwt-column>
  </lwt-table>
</template>

<script>
export default {
  data() {
    return {
      table: [
        {
          month: "1月",
          total: 2213,
          value: 232,
          value1: 23324,
          addr: "床前明月光,疑是地上霜。举头望明月,低头思故乡。",
        },
        { month: "2月", total: 2213, value: 232, value1: 23324 },
        { month: "3月", total: 2213, value: 232, value1: 23324 },
        { month: "4月", total: 2213, value: 232, value1: 23324 },
        { month: "5月", total: 2213, value: 232, value1: 23324 },
        { month: "6月", total: 2213, value: 232, value1: 23324 },
        { month: "7月", total: 2213, value: 232, value1: 23324 },
        { month: "8月", total: 2213, value: 232, value1: 23324 },
        { month: "9月", total: 2213, value: 232, value1: 23324 },
        { month: "10月", total: 2213, value: 232, value1: 23324 },
        { month: "11月", total: 2213, value: 232, value1: 23324 },
        { month: "12月", total: 2213, value: 232, value1: 23324 },
      ],
    };
  },
};
</script>

隐私、权限声明

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

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

插件不采集任何数据

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

许可协议

MIT协议

暂无用户评论。

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