0.3.4 • Published 2 years ago

lyz-table v0.3.4

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

lyz-table

移动端高度自定义表格组件

组件名:lyz-table

用于展示移动端高度自定义表格

平台差异说明

目前仅支持 vue2 移动端

组件使用注意事项

为了避免错误使用,给大家带来不好的开发体验,请在使用组件前仔细阅读下面的注意事项,可以帮你避免一些错误。

  • 组件为全局组件

基本用法

// main.js 注册全局
import lyzTable from 'lyz-table'
Vue.use(lyzTable)

API

lyzTable Props

属性名类型默认值说明
titleString表格标题后面会升级为具名插槽 |
columnsArray[]表格配置项(详细配置参考下方说明)
listArray[]表格数据列表
stickyBooleanfalse是否固定表头

lyzTable Slot

插槽名说明返回参数
nodata列表数据为空时展示插槽内容Slot&dom
columns根据数据配置项中的key生成具名插槽可覆盖默认内容Slot&dom

lyzTable Columns

属性名类型默认值说明
titleString列头显示文字无 |
keyString列数据在数据项中对应的 key
fixedString''列是否固定, 'left' 'right'
styleObject{}列头样式与正常的内联写法一致(注:所有属性使用驼峰写法)
columnStyleObject{}列样式与正常的内联写法一致(注:所有属性使用驼峰写法)

需要注意的是

columns 中的 style 默认是当前列生效(列头和列) 可以配置 columnStyle 来覆盖列头所产生的样式影响

lyzTable Examples

<template>
  <div >
		<tableLyz style="padding: 0 34px 0 24px;" :columns="groupColumns" :list="groupList">
			  <template slot="nodata">暂无数据</template>
			</tableLyz>
			 </div>
	</template>
	<script>
	export default {
	  data () {
	    return {
			groupList: [{
			        statTime: '111',
			        groupTotal: 11,
			        groupInc: 222,
			        groupCustomTotal: 2223,
			        groupCustomInc: 43,
			        groupCustomDec: 12
			      }, {
			        statTime: '111',
			        groupTotal: 11,
			        groupInc: 222,
			        groupCustomTotal: 2223,
			        groupCustomInc: 43,
			        groupCustomDec: 12
			      }, {
			        statTime: '111',
			        groupTotal: 11,
			        groupInc: 222,
			        groupCustomTotal: 2223,
			        groupCustomInc: 43,
			        groupCustomDec: 12
			      }, {
			        statTime: '111',
			        groupTotal: 11,
			        groupInc: 222,
			        groupCustomTotal: 2223,
			        groupCustomInc: 43,
			        groupCustomDec: 12
			      }, {
			        statTime: '111',
			        groupTotal: 11,
			        groupInc: 222,
			        groupCustomTotal: 2223,
			        groupCustomInc: 43,
			        groupCustomDec: 12
			      }],
			      groupColumns: [{
			        title: '日期',
			        key: 'statTime',
			        fixed: 'left',
			        style: {
			          width: '120px',
			          color: '#494949',
			          paddingLeft: '10px',
			          textAlign: 'center'
			        },
			        columnStyle: {
			          width: '120px',
			          color: 'pink',
			        }
			      },
			      {
			        title: '客户群总数',
			        key: 'groupTotal',
			        style: {
			          width: '200px',
			          color: '#494949'
			        }
			      },
			      {
			        title: '新增客户群',
			        key: 'groupInc',
			        style: {
			          width: '200px',
			          color: '#494949'
			        }
			      },
			      {
			        title: '客户群总人数',
			        key: 'groupCustomTotal',
			        style: {
			          width: '200px',
			          color: '#494949'
			        }
			      }, {
			        title: '客户群新增人数',
			        key: 'groupCustomInc',
			        style: {
			          width: '200px',
			          color: '#494949'
			        }
			      }, {
			        title: '退群客户数',
			        key: 'groupCustomDec',
			        style: {
			          width: '200px',
			          color: '#494949'
			        }
			      }
			      ],
			}
	  }
	}
 

该组件由国大创软网络科技有限公司授权开源 www.guodachuangruan.com

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago