Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ant-design-vue/pro-table

Package Overview
Dependencies
Maintainers
4
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ant-design-vue/pro-table

Ant Design Pro table of Vue, easy to use pro scaffolding.

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
4
Weekly downloads
 
Created
Source

Ant Design Pro Table

NPM version Vue Support Vue Grammar Level NPM downloads License

ProTable - Advanced Tables

ProTable was created to solve the problem of having to write a lot of sample code for tables in a project, so a lot of common logic was encapsulated in it. These wrappers can be simply categorized as pre-defined behaviors and pre-defined logic.

Thanks to ProForm's capabilities, ProForm can take many forms, switch between query form types, set up deformations to become a simple Form form, perform new creation, etc.

layout

When to Use

When your forms need to interact with the server or need multiple cell styles, ProTable is the right choice.

API

ProTable puts a layer of wrapping on top of antd's Table, supports some presets, and encapsulates some behaviors. Only api's that differ from antd Table are listed here.

request

request is the most important API of ProTable, request takes an object. The object must have data and success in it, and total is also required if manual paging is needed. request takes over the loading settings and re-executes them when the query form is queried and the params parameters are modified. Also the query form values and params parameters are brought in. The following is an example.

<ProTable
  // params is a parameter that needs to be self-contained
  // This parameter has higher priority and will override the parameters of the query form
  params={params}
  request={async (
    // The first parameter params is the combination of the query form and params parameters
    // The first parameter will always have pageSize and current, which are antd specifications
    { current, pageSize, ...params },
    sort,
    filter,
  ) => {
    // Here you need to return a Promise, and you can transform the data before returning it
    // If you need to transform the parameters you can change them here
    const {
      data: { result: data, total },
    } = await axios.get<{
      result: Record<string, unknown>[];
      total: number;
    }>('/api', {
      params: { page: current, pageSize, ...params },
    });
    return {
      data,
      // not passed will use the length of the data, if it is paged you must pass
      total,
      // Please return true for success.
      // otherwise the table will stop parsing the data, even if there is data
      success: true,
    };
  }}
/>

Attributes

NameDescriptionTypeDefault Value
requestHow to get dataSource(params?: {pageSize,current},sort,filter) => {data,success,total}-
paramsAdditional parameters used for request query, once changed will trigger reloadingobject-
cardBorderedBorder of Card components around Table and Searchboolean | {search?: boolean, table?: boolean}false
cardPropsCard's props which wrap the Table, not displayed when set to falsefalse | CardProps-
toolbarTransparent transmission of ListToolBar configuration items, not displayed when set to falsefalse | ListToolBarProps
optionstable toolbar, not displayed when set to false{{ reload: boolean | function, density?: boolean, setting: boolean, fullScreen: boolean | function }}{ reload :true, density: true, setting: true }

Slots

NameDescriptionTag
actionsRender toolbar actions areav-slot:actions
settingsRender toolbar settings area, will overwrite the optionsv-slot:settings

Events

NameDescriptionArguments
loadTriggered after the data is loaded, it will be triggered multiple times(dataSource: T[]) => void
requestErrorTriggered when data loading fails(error: Error) => void

ListToolbar

Toolbar section for customizing forms.

ListToolBarProps

Toolbar configuration properties for lists and tables

ParametersDescriptionTypeDefault
titletitlenot implemented-
subTitlesubTitlenot implemented-
descriptiondescriptionnot implemented-
searchquery areanot implemented-
actionsactions areafalse | VNode[]-
settingssettings areafalse | (VNode | Setting)[]-
filterThe filter area, usually used with LightFilternot implemented-
multipleLineWhether to display multiple linesnot implemented-
menumenu configurationnot implemented-
tabsTabs configuration, only valid if multipleLine is truenot implemented-
Setting
ParametersDescriptionTypeDefault
iconiconReactNode-
tooltiptooltip Descriptionstring-
keyoperation unique identifierstring-
onClickset to be triggered(key: string)=>void-

FAQs

Package last updated on 02 Jun 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc