From ba3dfc720d5ba822460bdea503461354ef4d3b3c Mon Sep 17 00:00:00 2001 From: liuhanchen Date: Fri, 16 Jun 2023 15:58:43 +0800 Subject: [PATCH] feat: 更新表格文档 --- examples/views/docs/component/schema-table.md | 12 +++++++----- examples/views/docs/component/table.md | 304 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------- 2 files changed, 290 insertions(+), 26 deletions(-) diff --git a/examples/views/docs/component/schema-table.md b/examples/views/docs/component/schema-table.md index a50b3d3..33c5399 100644 --- a/examples/views/docs/component/schema-table.md +++ b/examples/views/docs/component/schema-table.md @@ -130,11 +130,13 @@ export default { - - - + diff --git a/examples/views/docs/component/table.md b/examples/views/docs/component/table.md index c0ae9b7..e66686d 100644 --- a/examples/views/docs/component/table.md +++ b/examples/views/docs/component/table.md @@ -2,21 +2,23 @@ 拓展ElementUI的`el-table` -## 基础用法 +## 原始用法 基本参数与ElementUI的`el-table`相同。 -::: snippet 支持来自表单的`size`继承 +::: snippet 相当于直接使用`el-table` ```html +``` + +::: + +## 编辑器对象取值与赋值 + +编辑器可对深层对象进行双向绑定,通过`deep`参数来配置 + +::: snippet 表格配置项也支持对象的深层取值 + +```html + + + +``` + +::: + +## 编辑器条件渲染 + +编辑器支持通过行内的某些数值来进行条件渲染,支持配置`if`来进行条件渲染。 + +::: snippet `if`同时支持**boolean**和**function**两种类型,其中**function**可拿到当前行数据 + +```html + + + +``` + +::: + +## 编辑器条件渲染扩展 + +除了`if`之外,`props`、`attrs`、`on`都支持条件渲染 + +::: snippet 同时支持**boolean**和**function**两种类型,其中**function**可拿到当前行数据 + +```html + + + +``` + +::: + +## 编辑器校验 + +编辑器默认支持`el-form`的单元格校验,配置`editor`参数中的`validate`开启校验模式,配置`editor`参数中的`path`设置当前表格在form表单中的路径,表头会根据rules自动判断是否必填项追加`*`号 + +::: snippet 配置编辑器`editor`下的`rules`设置单元格的校验规则,也可以在`items`的`rules`中配置用以支持条件渲染 + +```html + + + +``` + +::: + ## API ## Attribute 属性 @@ -195,6 +458,5 @@ export default { 参数|说明|类型|可选值|默认值 -|-|-|-|- data | 表格数据 | Array | - | - -value | 表格数据(支持v-model) | Array | - | [] columns | 表格列配置 | Array | - | [] -type | 表格类型 | String | normal、editable | normal \ No newline at end of file +editor | 编辑器配置 | Object | - | - \ No newline at end of file -- libgit2 0.21.0