跪拜 Guibai
← Back to the summary

Single Source of Truth: VTable Guild 3.0.0 Derives Query, Edit, and Display from One Column Config

VTable Guild 3.0.0 Release: A ProTable-Style Business Table for Vue 3

Author: parade岁月

Tag: Frontend

A Vue 3 table component for ant-design-vue / element-plus projects. Version 3.0.0 is officially released.

Package version: @vtable-guild/[email protected]


While working on VTable Guild, I kept thinking about a question: besides displaying data, can a table component also consolidate those repetitive business capabilities that appear over and over but aren't worth rewriting in every project?

Take the "Status" column in a member list. The table needs to show "Enabled" and "Disabled", and the query area and editor also need the same set of options. When building such a page with 2.8.1, you typically had to configure the query form, the edit control, and the status display separately. With 3.0.0, you can generate the query field, define the editor, and specify the display mode from the same column configuration.

What's new in 3.0.0

Here is the status column configuration for a member list. valueEnum is defined only once; the table uses it to display Chinese labels, and both the query and edit features can use it to generate dropdown options.

import type { TableColumnsType } from '@vtable-guild/vtable-guild'

const columns: TableColumnsType<{ status: number }> = [
  {
    title: 'Status',
    dataIndex: 'status',
    valueEnum: new Map([
      [1, 'Enabled'],
      [0, 'Disabled'],
    ]),
    valueType: 'tag',
    editor: { valueType: 'select' },
  },
]

Generate the query area from column configuration

Pass columns to VTableQuery and it can derive a dropdown query field from the "Status" column. To adjust field order or switch controls, use the search configuration on the column. Fields like action columns can be excluded with search: false. Query drafts, parameter transformation, submission, and reset are handled by useTableQuery. View the column-configuration-derived example

The default QueryFilter renders query conditions as a form. When set to layout-type="LightFilter", common conditions appear as tags; clicking opens a filter popup.

light-filter.png

The LightFilter example on the docs site. After selecting "Completed", the request count and submitted parameters are shown below. Try LightFilter

Inline editing and draft validation

By using useTableEditable to access the editor in bodyCell, the "Status" column above can use the same set of enums as editing options. Query and editing can share controls registered through the adapter factory for Ant Design Vue or Element Plus. The editing API manages row drafts, cancellation, and validation; the business decides which rows or cells are editable and calls its own interface in onSave. View how to integrate editable columns

Batch submission can also use this draft mechanism. For example, in a purchase requisition with a dozen rows, the last row's name is missing and has scrolled out of view. After clicking submit, the page can validate that row and scroll the table to it. After filling in the name, if the simulated API fails, the draft remains and you can retry directly.

purchase-detail.gif

Purchase requisition demo in the local Playground. The table manages drafts and validation results; the demo page handles submission and error locating. View detail form integration

Unified display with field renderers

valueType: 'tag' renders the status as a tag, with text from valueEnum. Amounts, dates, and percentages can also be formatted with built-in renderers, saving you from writing repetitive formatting logic in each page's bodyCell. For business displays like member links with tooltips, you can define custom types with createTableRenderers and reuse them across tables. View built-in types and custom renderers

Other updates

A familiar table model, with complex-scenario capabilities

VTable Guild is aimed at projects already using Vue 3 with ant-design-vue or element-plus. It keeps the familiar columns configuration and table interaction as much as possible, while providing virtual scrolling, column width control, theme presets, and the optional business enhancements described above.

The same table logic can use either the Ant Design Vue or Element Plus preset. Styling is handled through theme configuration and instance-level ui overrides, so you don't need to keep adding hard-to-maintain global CSS for local tweaks.

hero-preset-switch.gif

With the same data and columns configuration, switching themePreset changes the header, borders, and row height according to the preset. Try both presets

It remains a component focused on tables, not a complete admin framework. Query, editing, and request capabilities provide composable tools, but page flow, permissions, transactions, and data submission still belong to the business project.

New Logo: giving the project a clearer identity

logo.svg

The new Logo is used on the docs site, Playground, and related project pages. The layered structure corresponds to the data hierarchy of the table; the letter V comes from the name VTable Guild.

Upgrading from 2.8.1

Installation command:

pnpm add @vtable-guild/vtable-guild@3
// main.ts
import { createApp } from 'vue'
import { createVTableGuild } from '@vtable-guild/vtable-guild'
import '@vtable-guild/vtable-guild/css/style'
import App from './App.vue'

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

For detailed integration, the two presets, and CSS modes, see the Quick start documentation.

Project links