Convert Figma logo to code with AI

x-extends logovxe-table

Vxe table 的表格组件

7,571
1,047
7,571
922

Top Related Projects

:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin

54,165

A Vue.js 2.0 UI Toolkit for Web

23,961

A high quality UI Toolkit built on Vue.js 2.0

39,994

🐉 Vue Component Framework

9,547

Lightweight UI components for Vue.js based on Bulma

BootstrapVue provides one of the most comprehensive implementations of Bootstrap v4 for Vue.js. With extensive and automated WAI-ARIA accessibility markup.

Quick Overview

vxe-table is a powerful Vue.js table component library that provides a rich set of features for creating complex, interactive tables. It offers high performance, customizable styling, and a wide range of built-in functionalities such as sorting, filtering, and editing.

Pros

  • Comprehensive feature set, including advanced table operations like virtual scrolling, cell merging, and tree structure
  • High performance, capable of handling large datasets efficiently
  • Extensive documentation and examples available
  • Active development and community support

Cons

  • Steep learning curve due to the extensive API and configuration options
  • Large bundle size, which may impact initial load times for smaller applications
  • Some users report occasional bugs or inconsistencies in certain edge cases
  • Limited built-in themes, requiring additional customization for unique designs

Code Examples

  1. Basic table setup:
<template>
  <vxe-table :data="tableData">
    <vxe-column field="name" title="Name"></vxe-column>
    <vxe-column field="age" title="Age"></vxe-column>
    <vxe-column field="address" title="Address"></vxe-column>
  </vxe-table>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        { name: 'John', age: 28, address: 'New York' },
        { name: 'Jane', age: 32, address: 'London' },
      ]
    }
  }
}
</script>
  1. Table with sorting and filtering:
<template>
  <vxe-table :data="tableData" :sort-config="{}" :filter-config="{}">
    <vxe-column field="name" title="Name" sortable></vxe-column>
    <vxe-column field="age" title="Age" sortable></vxe-column>
    <vxe-column field="address" title="Address" :filters="addressFilters"></vxe-column>
  </vxe-table>
</template>

<script>
export default {
  data() {
    return {
      tableData: [...],
      addressFilters: [
        { label: 'New York', value: 'New York' },
        { label: 'London', value: 'London' },
      ]
    }
  }
}
</script>
  1. Editable table with validation:
<template>
  <vxe-table :data="tableData" :edit-config="{trigger: 'click', mode: 'cell'}">
    <vxe-column field="name" title="Name" :edit-render="{name: 'input'}"></vxe-column>
    <vxe-column field="age" title="Age" :edit-render="{name: 'input', props: {type: 'number'}}">
      <template #edit="{ row }">
        <vxe-input v-model="row.age" type="number" :min="0" :max="120"></vxe-input>
      </template>
    </vxe-column>
    <vxe-column field="address" title="Address" :edit-render="{name: 'input'}"></vxe-column>
  </vxe-table>
</template>

Getting Started

  1. Install vxe-table and its dependencies:

    npm install xe-utils vxe-table
    
  2. Import and use vxe-table in your Vue.js application:

    import Vue from 'vue'
    import 'xe-utils'
    import VXETable from 'vxe-table'
    import 'vxe-table/lib/style.css'
    
    Vue.use(VXETable)
    
  3. Use vxe-table components in your Vue template as shown in the code examples above.

Competitor Comparisons

:tada: A magical vue admin https://panjiachen.github.io/vue-element-admin

Pros of vue-element-admin

  • Comprehensive admin panel solution with rich features and components
  • Well-documented and maintained, with a large community
  • Includes built-in authentication, permission management, and i18n support

Cons of vue-element-admin

  • Steeper learning curve due to its complexity and extensive features
  • May be overkill for smaller projects or those not requiring a full admin panel
  • Tightly coupled with Element UI, which may limit customization options

Code Comparison

vue-element-admin (router configuration):

{
  path: '/permission',
  component: Layout,
  redirect: '/permission/page',
  name: 'Permission',
  meta: {
    title: 'Permission',
    icon: 'lock',
    roles: ['admin', 'editor']
  },
  children: [
    // ...
  ]
}

vxe-table (table configuration):

<vxe-table
  :data="tableData"
  :columns="tableColumns"
  :edit-config="{trigger: 'click', mode: 'cell'}"
>
  <vxe-table-column type="checkbox" width="60"></vxe-table-column>
  <vxe-table-column field="name" title="Name"></vxe-table-column>
  // ...
</vxe-table>

While vue-element-admin provides a complete admin panel solution, vxe-table focuses on delivering a powerful and flexible table component for Vue applications. The choice between them depends on the specific project requirements and scope.

54,165

A Vue.js 2.0 UI Toolkit for Web

Pros of Element

  • Larger community and ecosystem, with more third-party components and resources
  • More comprehensive UI component library, covering a wider range of use cases
  • Better documentation and examples, making it easier for developers to get started

Cons of Element

  • Heavier bundle size, which may impact performance for smaller applications
  • Less focused on table functionality compared to VXE-Table
  • Slower release cycle and potentially longer time to address issues or implement new features

Code Comparison

Element table example:

<el-table :data="tableData" style="width: 100%">
  <el-table-column prop="date" label="Date" width="180" />
  <el-table-column prop="name" label="Name" width="180" />
  <el-table-column prop="address" label="Address" />
</el-table>

VXE-Table example:

<vxe-table :data="tableData">
  <vxe-column field="date" title="Date" width="180" />
  <vxe-column field="name" title="Name" width="180" />
  <vxe-column field="address" title="Address" />
</vxe-table>

Both libraries offer similar syntax for basic table implementation, but VXE-Table provides more advanced table features out of the box, while Element offers a broader range of UI components beyond tables.

23,961

A high quality UI Toolkit built on Vue.js 2.0

Pros of iView

  • Comprehensive UI component library with a wide range of elements
  • Well-documented with extensive examples and API references
  • Active community and regular updates

Cons of iView

  • Larger bundle size due to the extensive component set
  • Less flexible for customization compared to more focused libraries
  • Steeper learning curve for developers new to the framework

Code Comparison

iView table example:

<Table :columns="columns" :data="data">
  <template #action="{ row }">
    <Button type="primary" size="small" @click="handleEdit(row)">Edit</Button>
    <Button type="error" size="small" @click="handleDelete(row)">Delete</Button>
  </template>
</Table>

vxe-table example:

<vxe-table :data="tableData" :columns="tableColumns">
  <template #operate="{ row }">
    <vxe-button @click="editEvent(row)">Edit</vxe-button>
    <vxe-button @click="deleteEvent(row)">Delete</vxe-button>
  </template>
</vxe-table>

Both libraries offer table components with similar functionality, but vxe-table focuses specifically on table features, potentially offering more advanced options for complex table scenarios. iView provides a more general-purpose UI toolkit, which may be beneficial for projects requiring a consistent design across various components beyond just tables.

39,994

🐉 Vue Component Framework

Pros of Vuetify

  • Comprehensive UI component library with a wide range of pre-built components
  • Strong community support and extensive documentation
  • Material Design compliance out of the box

Cons of Vuetify

  • Larger bundle size due to its extensive feature set
  • Customization can be more complex for highly specific designs
  • Steeper learning curve for beginners due to its extensive API

Code Comparison

Vuetify table example:

<v-data-table
  :headers="headers"
  :items="desserts"
  :items-per-page="5"
  class="elevation-1"
></v-data-table>

vxe-table example:

<vxe-table
  :data="tableData"
  :columns="tableColumns"
>
</vxe-table>

Both libraries offer table components, but Vuetify's implementation follows Material Design principles, while vxe-table focuses on high-performance tables with more advanced features. Vuetify provides a more opinionated structure, whereas vxe-table offers greater flexibility for custom table configurations.

Vuetify is better suited for projects requiring a complete Material Design-based UI framework, while vxe-table excels in scenarios demanding complex, high-performance table functionality. The choice between the two depends on the specific needs of your project, such as design requirements, performance considerations, and the scope of UI components needed.

9,547

Lightweight UI components for Vue.js based on Bulma

Pros of Buefy

  • Lightweight and modular design, allowing for easy customization and smaller bundle sizes
  • Extensive documentation and active community support
  • Seamless integration with Bulma CSS framework, providing a consistent design system

Cons of Buefy

  • Less feature-rich compared to VXE-Table, especially for complex data grid functionalities
  • May require additional plugins or custom development for advanced table features
  • Slower performance for large datasets compared to VXE-Table's optimized rendering

Code Comparison

Buefy table example:

<b-table :data="data" :columns="columns">
  <template slot-scope="props">
    <b-table-column field="name" label="Name">{{ props.row.name }}</b-table-column>
    <b-table-column field="age" label="Age">{{ props.row.age }}</b-table-column>
  </template>
</b-table>

VXE-Table example:

<vxe-table :data="data">
  <vxe-table-column field="name" title="Name"></vxe-table-column>
  <vxe-table-column field="age" title="Age"></vxe-table-column>
</vxe-table>

Both libraries offer Vue-based table components, but VXE-Table provides more advanced features out-of-the-box, while Buefy focuses on simplicity and integration with Bulma. VXE-Table is better suited for complex data grids, while Buefy excels in creating lightweight, customizable UI components.

BootstrapVue provides one of the most comprehensive implementations of Bootstrap v4 for Vue.js. With extensive and automated WAI-ARIA accessibility markup.

Pros of Bootstrap Vue

  • Extensive component library based on Bootstrap, offering a wide range of pre-built UI elements
  • Strong community support and regular updates, ensuring compatibility with the latest Vue versions
  • Comprehensive documentation with examples and playground for easy learning and implementation

Cons of Bootstrap Vue

  • Larger bundle size due to the inclusion of Bootstrap CSS and JavaScript
  • Less flexibility in customizing table components compared to VXE-Table's advanced features
  • May require additional configuration for complex data handling and rendering scenarios

Code Comparison

Bootstrap Vue table example:

<b-table
  :items="items"
  :fields="fields"
  striped
  hover
  responsive="sm"
></b-table>

VXE-Table example:

<vxe-table
  :data="tableData"
  :columns="tableColumns"
  stripe
  border
  resizable
></vxe-table>

Both libraries offer simple table implementations, but VXE-Table provides more built-in features for advanced table functionality out of the box.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

vxe-table

简体中文 | 繁體中文 | English | 日本語

star npm version NodeJS with Webpack npm downloads issues issues closed pull requests pull requests closed npm license

一个基于 vue 的 PC 端表单/表格组件,支持增删改查、虚拟树、列拖拽、懒加载、快捷菜单、数据校验、导入/导出/打印、表单渲染、自定义模板、渲染器、JSON 配置式...

  • 设计理念

    • 面向现代浏览器,高效的简洁 API 设计
    • 按需加载
  • 计划

    • v1.0 基于 vue2.6,支持所有主流的浏览器,实现表格的一切实用的功能
    • v2.0 基于 vue2.6,支持所有主流的浏览器,同时兼具功能与性能
    • v3.0 基于 vue2.6+,支持现代浏览器并保留兼容 IE11
    • v3.9 基于 vue2.6+,内部重构,只支持现代浏览器,不支持 IE
    • v4.0 基于 vue3.2+,只支持现代浏览器,不支持 IE
    • v4.7 基于 vue3.2+,内部重构,只支持现代浏览器,不支持 IE
    • 下一阶段:sticky 渲染模式、将虚拟滚动提升到极致、虚拟滚动动态行高、数据图表可视化

浏览器支持

EdgeChromeFirefoxOperaSafari
80+ ✔80+ ✔90+ ✔75+ ✔10+ ✔

功能点

  • 基础表格
  • 配置式表格
  • 斑马线条纹
  • 多种边框
  • 单元格样式
  • 列宽拖动
  • 最小/最大高度
  • 自适应宽高
  • 固定列
  • 多级表头
  • 表尾数据
  • 高亮行或列
  • 序号
  • 单选框
  • 复选框
  • 排序
  • 多字段排序
  • 筛选
  • 合并单元格
  • 合并表尾
  • 导入/导出/打印
  • 显示/隐藏列
  • 拖拽/自定义列排序
  • 加载中
  • 格式化内容
  • 自定义插槽 - 模板
  • 快捷菜单
  • 展开行
  • 工具栏
  • 虚拟树
  • 增删改查
  • 数据校验
  • 数据代理
  • 键盘导航
  • 渲染器
  • 虚拟滚动
  • 虚拟合并
  • CSS 变量主题
  • (企业版) 单元格区域选取
  • (企业版) 单元格复制/粘贴
  • (企业版) 单元格查找和替换
  • (企业版) 全键盘操作

安装

版本:vue 3.x

npm install vxe-table@next

Get on unpkg and cdnjs

NPM

只使用表格

// ...
import VxeTable from 'vxe-table'
import 'vxe-table/lib/style.css'
// ...

createApp(App).use(VxeTable).mount('#app')

使用表格与 UI 库

// ...
import VxeTable from 'vxe-table'
import 'vxe-table/lib/style.css'
// ...

import VxeUI from 'vxe-pc-ui'
import 'vxe-pc-ui/lib/style.css'
// ...

createApp(App).use(VxeUI).use(VxeTable).mount('#app')

CDN

使用第三方 CDN 方式记得锁定版本号,避免受到非兼容性更新的影响
不建议将第三方的 CDN 地址用于正式环境,因为该连接随时都可能会失效

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <!-- style -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vxe-pc-ui@4/lib/style.css">
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vxe-table@4/lib/style.css">
  <!-- vue -->
  <script src="https://cdn.jsdelivr.net/npm/vue@3"></script>
  <!-- table -->
  <script src="https://cdn.jsdelivr.net/npm/xe-utils"></script>
  <script src="https://cdn.jsdelivr.net/npm/vxe-pc-ui@4"></script>
  <script src="https://cdn.jsdelivr.net/npm/vxe-table@4"></script>
</head>
<body>
  <div id="app">
    <div>
      <vxe-table :data="tableData">
        <vxe-column type="seq" title="Seq" width="60"></vxe-column>
        <vxe-column field="name" title="Name"></vxe-column>
        <vxe-column field="role" title="Role"></vxe-column>
        <vxe-colgroup title="Group1">
          <vxe-column field="sex" title="Sex"></vxe-column>
          <vxe-column field="address" title="Address"></vxe-column>
        </vxe-colgroup>
      </vxe-table>
    </div>
  </div>
  <script>
    (function () {
      var App = {
        data() {
          return {
            tableData: [
              { id: 10001, name: 'Test1', role: 'Develop', sex: 'Man', address: 'Shenzhen' },
              { id: 10002, name: 'Test2', role: 'Test', sex: 'Man', address: 'Guangzhou' },
              { id: 10003, name: 'Test3', role: 'PM', sex: 'Man', address: 'Shanghai' }
            ]
          }
        }
      }
      Vue.createApp(App).use(VxeUI).use(VXETable).mount('#app')
    })()
  </script>
</body>
</html>

示例

<template>
  <div>
    <vxe-table :data="tableData">
      <vxe-column type="seq" title="Seq" width="60"></vxe-column>
      <vxe-column field="name" title="Name"></vxe-column>
      <vxe-column field="role" title="Role"></vxe-column>
      <vxe-colgroup title="Group1">
        <vxe-column field="sex" title="Sex"></vxe-column>
        <vxe-column field="address" title="Address"></vxe-column>
      </vxe-colgroup>
    </vxe-table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        { id: 10001, name: 'Test1', role: 'Develop', sex: 'Man', address: 'Shenzhen' },
        { id: 10002, name: 'Test2', role: 'Test', sex: 'Man', address: 'Guangzhou' },
        { id: 10003, name: 'Test3', role: 'PM', sex: 'Man', address: 'Shanghai' }
      ]
    }
  }
}
</script>

在线文档

👉 组件文档
👉 表格文档

QQ 交流群

该群供大家交流問題,如果群人数已满,将会不定期剔除不活跃的。

qq qq

运行项目

安装依赖

npm run update

启动本地调试

npm run serve

编译打包,生成编译后的目录:es,lib

npm run lib

Contributors

Thank you to everyone who contributed to this project.

vxe-table

License

MIT © 2019-present, Xu Liangzhan

NPM DownloadsLast 30 Days