Giter Site home page Giter Site logo

uniapp-elemnt-table's Introduction

no-bad-table

取名nobadtable,源于它看起来不是特别的糟糕

这里默认大家都非常熟悉vue和uniapp的包引入,不再阐述uniapp组件引入方法以及uniapp组件和vue的区别

插件市场更新会比github更新延后,查看github项目

插件市场更新会比github更新延后,查看demo源码

插件市场更新会比github更新延后,查看demo使用引入方式

如果本项目给你带来了便利,请给个star

支持功能大概如下

固定高度不支持同时固定某一列

已测试平台 ->ios,android,wap,微信小程序

基本使用示例源码

html

    <v-table :columns="columns" :list="data"></v-table>

javascript (data数组必须提供id)

	import vTable from "@/components/table.vue"
	export default{
		components: {
			vTable
		},
		data(){
			return {
				data: [{
						name: 'John Brown',
						age: 18,
						address: 'New York No. 1 Lake Park',
						id: "1",
						
					}
				],
				columns: [{
						title: "ID",
						key: "id"
					},
					{
						title: 'Name',
						key: 'name'
					},
					{
						title: 'Age',
						key: 'age'
					},
					{
						title: 'Address',
						key: 'address'
					}
				],
			}
		}
		
	}

赞助我买咖啡

如果作者的行为给你带来了便利,打赏入口在下面

如果有需要作者协助的地方,打赏在下面

O(∩_∩)O哈哈~

基本属性

html标签属性

属性 说明 类型 默认 必填
columns 列数据 Array -- 必填
dataColSpan 行数据 Array -- 必填
row-class-name 行样式 String或Function -- --
height 表格高度(可用固定表头) Number -- --
td-height 单元格高 Number 110 --
cel-center 单元格水平居中 Boolean true --
td-width 单元格宽 Number 30 --
td-padding 单元格间距 Number 10 --
border-color 表格边框颜色 String #666 --
th-td-height 表头单元格高 Number 30 --
loading 加载状态 Boolean false --
selection 可选mulit和single String -- --
fixed-checkbox 固定多选列 和selection="mulit"共存 Boolean false --
span-method 行列合并 Function -- --
slot-cols 插槽自定义列元素,对应columns的key Array -- --
emptyText 插没数据提示文字 String -- --
emptyClickFn 没数据点击响应函数 Function -- --

事件

属性 说明 参数
@on-selection-change 单选 多选变更 {old:"",new:""}
@delete 自定义事件(它可以不叫delete,可以是任意事件,只要你在list里面定义了) {row:{},index:Number}

list 参数

属性 说明 类型
cellClassName 设置行内某一列的样式类名 Object
operate 数据操作的列 Object

columns 参数

属性 说明 类型
$width 设置列宽度 例如 "120px",请务必使用px单位 String
$fixed 固定某一列,可选left和right String
$operateList 数据操作选项和list的operate对应 Array

uniapp-elemnt-table's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

uniapp-elemnt-table's Issues

关于table插槽使用bug

2020/04/06下载后,使用发现使用slot时,以前的数据会一并显示,经本人测试发现,在table.vue中的54行,第一个slotCols的下面template中的v-if使用有误,应改为v-else-if并增加判断条件slotCols.indexOf(tdItem.key)<0。

自定义行样式的css写在哪里

rowClassNameFn(row, index) { if (index === 1) { return 'demo-table-info-row'; } else if (index === 3) { return 'demo-table-error-row'; } return ''; }

'demo-table-error-row 这个样式 写在table.css里面吗 为什么我写进去 无效呢

样式是怎么加载的呢

您好 , 我是一个新手,可以请教一下 这个组件的样式怎么加载的吗
我用你的demo里面的代码 加载后是这样的
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.