1 | # vxe-table
|
2 |
|
3 | 简体中文 | [繁體中文](README.zh-TW.md) | [English](README.en.md)
|
4 |
|
5 | [![star](https://gitee.com/xuliangzhan_admin/vxe-table/badge/star.svg?theme=gvp)](https://gitee.com/xuliangzhan_admin/vxe-table/stargazers)
|
6 | [![npm version](https://img.shields.io/npm/v/vxe-table.svg?style=flat-square)](https://www.npmjs.com/package/vxe-table)
|
7 | [![npm build](https://app.travis-ci.com/x-extends/vxe-table.svg?branch=master)](https://app.travis-ci.com/x-extends/vxe-table)
|
8 | [![npm downloads](https://img.shields.io/npm/dt/vxe-table.svg?style=flat-square)](https://npm-stat.com/charts.html?package=vxe-table)
|
9 | [![issues](https://img.shields.io/github/issues/x-extends/vxe-table.svg)](https://github.com/x-extends/vxe-table/issues)
|
10 | [![issues closed](https://img.shields.io/github/issues-closed/x-extends/vxe-table.svg)](https://github.com/x-extends/vxe-table/issues?q=is%3Aissue+is%3Aclosed)
|
11 | [![pull requests](https://img.shields.io/github/issues-pr/x-extends/vxe-table.svg)](https://github.com/x-extends/vxe-table/pulls)
|
12 | [![pull requests closed](https://img.shields.io/github/issues-pr-closed/x-extends/vxe-table.svg)](https://github.com/x-extends/vxe-table/pulls?q=is%3Apr+is%3Aclosed)
|
13 | [![npm license](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)
|
14 |
|
15 | 一个基于 [vue](https://www.npmjs.com/package/vue) 的 PC 端表单/表格组件,支持增删改查、虚拟树、列拖拽、懒加载、快捷菜单、数据校验、打印导出、表单渲染、自定义模板、渲染器、JSON 配置式...
|
16 |
|
17 | * 设计理念
|
18 | * 面向现代浏览器,高效的简洁 API 设计
|
19 | * 模块化表格、按需加载
|
20 | * 为单行编辑表格而设计,支持增删改查及更多扩展,强大的功能的同时兼具性能
|
21 |
|
22 | ## 浏览器支持
|
23 |
|
24 | ![Edge](https://raw.github.com/alrra/browser-logos/master/src/edge/edge_48x48.png) | ![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png) | ![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png) | ![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png) | ![Safari](https://raw.github.com/alrra/browser-logos/master/src/safari/safari_48x48.png)
|
25 | --- | --- | --- | --- | --- |
|
26 | 80+ ✔ | 80+ ✔ | 90+ ✔ | 75+ ✔ | 10+ ✔ |
|
27 |
|
28 | ## 功能点
|
29 |
|
30 | * [x] 基础表格
|
31 | * [x] 配置式表格
|
32 | * [x] 斑马线条纹
|
33 | * [x] 多种边框
|
34 | * [x] 单元格样式
|
35 | * [x] 列宽拖动
|
36 | * [x] 最小/最大高度
|
37 | * [x] 自适应宽高
|
38 | * [x] 固定列
|
39 | * [x] 多级表头
|
40 | * [x] 表尾数据
|
41 | * [x] 高亮行或列
|
42 | * [x] 序号
|
43 | * [x] 单选框
|
44 | * [x] 复选框
|
45 | * [x] 排序
|
46 | * [x] 多字段排序
|
47 | * [x] 筛选
|
48 | * [x] 合并单元格
|
49 | * [x] 合并表尾
|
50 | * [x] 导入/导出/打印
|
51 | * [x] 显示/隐藏列
|
52 | * [x] 拖拽/自定义列排序
|
53 | * [x] 加载中
|
54 | * [x] 格式化内容
|
55 | * [x] 自定义插槽 - 模板
|
56 | * [x] 快捷菜单
|
57 | * [x] 展开行
|
58 | * [x] 工具栏
|
59 | * [x] 虚拟树
|
60 | * [x] 增删改查
|
61 | * [x] 数据校验
|
62 | * [x] 数据代理
|
63 | * [x] 键盘导航
|
64 | * [x] 渲染器
|
65 | * [x] 虚拟滚动
|
66 | * [x] 虚拟合并
|
67 | * [x] CSS 变量主题
|
68 | * [x] ([企业版](https://vxetable.cn/pluginDocs/)) 单元格区域选取
|
69 | * [x] ([企业版](https://vxetable.cn/pluginDocs/)) 单元格复制/粘贴
|
70 | * [x] ([企业版](https://vxetable.cn/pluginDocs/)) 单元格查找和替换
|
71 | * [x] ([企业版](https://vxetable.cn/pluginDocs/)) 全键盘操作
|
72 |
|
73 | ## 安装
|
74 |
|
75 | 版本:[vue](https://www.npmjs.com/package/vue) 3.x
|
76 |
|
77 | ```shell
|
78 | npm install vxe-table
|
79 | ```
|
80 |
|
81 | Get on [unpkg](https://unpkg.com/vxe-table/) and [cdnjs](https://cdn.jsdelivr.net/npm/vxe-table/)
|
82 |
|
83 | ### npm
|
84 |
|
85 | ```javascript
|
86 | import { createApp } from 'vue'
|
87 | import VXETable from 'vxe-table'
|
88 | import 'vxe-table/lib/style.css'
|
89 |
|
90 | createApp(App).use(VXETable).mount('#app')
|
91 | ```
|
92 |
|
93 | ### CDN
|
94 |
|
95 | 使用第三方 CDN 方式记得锁定版本号,避免受到非兼容性更新的影响
|
96 | ***不建议将第三方的 CDN 地址用于正式环境,因为该连接随时都可能会失效***
|
97 |
|
98 | ```HTML
|
99 | <!-- 引入样式 -->
|
100 | <link rel="stylesheet" href="https://unpkg.com/vxe-table/lib/style.css">
|
101 | <!-- 引入脚本 -->
|
102 | <script src="https://unpkg.com/xe-utils"></script>
|
103 | <script src="https://unpkg.com/vxe-table"></script>
|
104 | ```
|
105 |
|
106 | ## 示例
|
107 |
|
108 | ```html
|
109 | <template>
|
110 | <div>
|
111 | <vxe-table :data="tableData">
|
112 | <vxe-column type="seq" title="Seq" width="60"></vxe-column>
|
113 | <vxe-column field="name" title="Name"></vxe-column>
|
114 | <vxe-column field="role" title="Role"></vxe-column>
|
115 | <vxe-colgroup title="Group1">
|
116 | <vxe-column field="sex" title="Sex"></vxe-column>
|
117 | <vxe-column field="address" title="Address"></vxe-column>
|
118 | </vxe-colgroup>
|
119 | </vxe-table>
|
120 | </div>
|
121 | </template>
|
122 |
|
123 | <script lang="ts" setup>
|
124 | import { ref } from 'vue'
|
125 |
|
126 | const tableData = ref([
|
127 | { id: 10001, name: 'Test1', role: 'Develop', sex: 'Man', address: 'Shenzhen' },
|
128 | { id: 10002, name: 'Test2', role: 'Test', sex: 'Man', address: 'Guangzhou' },
|
129 | { id: 10003, name: 'Test3', role: 'PM', sex: 'Man', address: 'Shanghai' }
|
130 | ])
|
131 | </script>
|
132 | ```
|
133 |
|
134 | ## 在线文档
|
135 |
|
136 | 👉 [官网文档](https://vxetable.cn)
|
137 |
|
138 | ## QQ 交流群
|
139 |
|
140 | 该群供大家交流問題,如果群人数已满,将会不定期剔除不活跃的。
|
141 |
|
142 | ![qq](https://vxetable.cn/static/donation/qq1.png)
|
143 | ![qq](https://vxetable.cn/static/donation/qq2.png)
|
144 |
|
145 | ## 运行项目
|
146 |
|
147 | 安装依赖
|
148 |
|
149 | ```shell
|
150 | npm run update
|
151 | ```
|
152 |
|
153 | 启动本地调试
|
154 |
|
155 | ```shell
|
156 | npm run serve
|
157 | ```
|
158 |
|
159 | 编译打包,生成编译后的目录:es,lib
|
160 |
|
161 | ```shell
|
162 | npm run lib
|
163 | ```
|
164 |
|
165 | ## Contributors
|
166 |
|
167 | Thank you to everyone who contributed to this project.
|
168 |
|
169 | [![vxe-table](https://contrib.rocks/image?repo=x-extends/vxe-table)](https://github.com/x-extends/vxe-table/graphs/contributors)
|
170 |
|
171 | ## License
|
172 |
|
173 | [MIT](LICENSE) © 2019-present, Xu Liangzhan
|