Skip to content

Commit 54deee8

Browse files
authored
Update README.md
1 parent 32a6a9a commit 54deee8

File tree

1 file changed

+64
-3
lines changed

1 file changed

+64
-3
lines changed

README.md

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,66 @@
11
# vue-easytable
2-
基于vue的表格插件,支持多表头固定、多列固定
32

4-
## 注意
5-
目前还在开发阶段,不适合开发使用!敬请期待...
3+
4+
## 介绍
5+
基于 vue2 的 组件。[API文档](http://doc.huangsw.com/vue-easytable/app.html)
6+
7+
8+
## 主要功能
9+
1. 自适应,可以随着浏览器窗口改变自动适应
10+
2. 固定列,表头固定
11+
3. 列宽拖动(默认支持)
12+
4. 排序,支持单个、多个字段排序
13+
5. 自定义列、自定义单元格样式、loading效果等
14+
6. 自带分页组件
15+
16+
## 安装
17+
18+
```
19+
npm install vue-easytable --save-dev
20+
```
21+
22+
## 使用
23+
24+
25+
```
26+
import 'vue-easytable/packages/themes-base/index.css'
27+
import {VTable,VPagination} from 'vue-easytable'
28+
29+
Vue.component(VTable.name, VTable)
30+
Vue.component(VPagination.name, VPagination)
31+
```
32+
33+
```html
34+
<template>
35+
<v-table
36+
:width="1100"
37+
:columns="tableConfig.columns"
38+
:table-data="tableConfig.tableData"
39+
></v-table>
40+
</template>
41+
```
42+
```javascript
43+
<script>
44+
45+
export default{
46+
data() {
47+
return {
48+
tableConfig: {
49+
tableData:[
50+
{"name":"tom","gender":"","job":"the cat"},
51+
{"name":"jerry","gender":"","job":"the mouse"},
52+
{"name":"张飞","gender":"","job":"勇而有义,皆万人之敌,而为之将"}
53+
],
54+
columns: [
55+
{field: 'name', title:'姓名', width: 80, titleAlign: 'center',columnAlign:'center'},
56+
{field: 'gender', title: '性别', width: 80, titleAlign: 'center',columnAlign:'center'},
57+
{field: 'job', title: '职业', titleAlign: 'center',columnAlign:'left'}
58+
]
59+
}
60+
}
61+
}
62+
}
63+
</script>
64+
```
65+
66+

0 commit comments

Comments
 (0)