feat: add filter docs for table, improve code

This commit is contained in:
Justineo
2020-12-22 16:33:30 +08:00
parent 9337660240
commit 4b8ad76e60
48 changed files with 260 additions and 190 deletions

View File

@@ -60,12 +60,12 @@
| 名称 | 描述 |
| -- | -- |
| `default` | [^scoped-slot-default] |
| `default` | [^slot-default] |
| `title` | 消息标题的内容区域。 |
| `extra` | 消息之后的额外内容区域。 |
| `content` | 整个消息区域,包括状态图标、切换按钮、关闭按钮等。 |
^^^scoped-slot-default
^^^slot-default
消息内容区域。
默认内容:消息文本。

View File

@@ -44,10 +44,10 @@
| 名称 | 描述 |
| -- | -- |
| `item` | [^scoped-slot-item] |
| `item-label` | [^scoped-slot-item-label] |
| `item` | [^slot-item] |
| `item-label` | [^slot-item-label] |
^^^scoped-slot-item
^^^slot-item
渲染每个锚点链接。
默认内容:锚点链接。
@@ -55,7 +55,7 @@
作用域参数参见 `items` 属性详情。
^^^
^^^scoped-slot-item-label
^^^slot-item-label
渲染每个锚点链接的文本。
默认内容:锚点链接的描述文本 `label`

View File

@@ -55,10 +55,10 @@
| 名称 | 描述 |
| -- | -- |
| `suggestions` | [^scoped-slot-suggestions] |
| `option-label` | [^scoped-slot-option-label] |
| `suggestions` | [^slot-suggestions] |
| `option-label` | [^slot-option-label] |
^^^scoped-slot-suggestions
^^^slot-suggestions
下拉建议面板插槽。
@@ -70,7 +70,7 @@
+++
^^^
^^^scoped-slot-option-label
^^^slot-option-label
下拉面板中选项插槽。

View File

@@ -69,9 +69,9 @@
| 名称 | 描述 |
| -- | -- |
| `default` | 按钮组内容区。 |
| `item` | [^scoped-slot-item] |
| `item` | [^slot-item] |
^^^scoped-slot-item
^^^slot-item
用来定制每个按钮的内容。
默认内容:`label` 属性值。

View File

@@ -35,7 +35,7 @@
| `week-start` | `number=` | `calendar.weekStart` | 一周的起始。可进行[全局配置](#全局配置)。 |
| `fill-month` | `boolean=` | `true` | 当只有一个面板时,是否要在当前月份面板显示非本月日期。 |
| `date-class` | `string|Array|Object|function=` | `{}` | 特定日期的自定义 HTML `class`。传非函数时,数据格式为所有 [Vue 支持的 `class` 表达式](https://cn.vuejs.org/v2/guide/class-and-style.html#%E7%BB%91%E5%AE%9A-HTML-Class);传函数时,签名为 `function(Date): string|Array<string>|Object<string, boolean>`,返回值格式亦为所有 Vue 支持的 `class` 表达式。 |
| `disabled-date` | `function(Date, Date=): boolean=` | `() => false` | 第一个参数为需要判断是否禁用的日期。当处于范围选择过程中且已经选择了一个日期,会作为第二个参数传入。 |
| `disabled-date` | `function(Date, Date=): boolean=` | `() => false` | 用于自定义指定日期是否禁用。第一个参数为需要判断是否禁用的日期。当处于范围选择过程中且已经选择了一个日期,会作为第二个参数传入。 |
| `disabled` | `boolean=` | `false` | 是否为禁用状态。 |
| `readonly` | `boolean=` | `false` | 是否为只读状态。 |
@@ -62,9 +62,9 @@
| -- | -- |
| `before` | 日历内,面板上方可供定制的区域。 |
| `after` | 日历内,面板下方可供定制的区域。 |
| `date` | [^scoped-slot-date] |
| `date` | [^slot-date] |
^^^scoped-slot-date
^^^slot-date
单日单元格内的区域,可用来定制每一天对应区域的内容。
默认内容:对应日期的 `date`

View File

@@ -81,9 +81,9 @@
| 名称 | 描述 |
| -- | -- |
| `item` | [^scoped-slot-item] |
| `item` | [^slot-item] |
^^^scoped-slot-item
^^^slot-item
可用来定制每个轮播项的区域。
默认内容:轮播项图片。

View File

@@ -62,9 +62,9 @@
| 名称 | 描述 |
| -- | -- |
| `item` | [^scoped-slot-item] |
| `item` | [^slot-item] |
^^^scoped-slot-item
^^^slot-item
按钮内文本区域。
默认内容:`label` 属性值。

View File

@@ -62,9 +62,9 @@
| 名称 | 描述 |
| -- | -- |
| `item` | [^scoped-slot-item] |
| `item` | [^slot-item] |
^^^scoped-slot-item
^^^slot-item
选项描述文本区域。
默认内容:`label` 属性值。

View File

@@ -21,6 +21,7 @@
| `align` | `string=` | - | 内容对齐方式,支持 `left`/`center`/`right`。 |
| `span` | `function(number): Object=` | | [^span] |
| `desc` | `string` | - | 表头描述。 |
| `filter-value` | `*` | - | 筛选条件取值,目前仅支持 `true` 表示已经过筛选。 |
^^^sortable
本列是否支持排序。
@@ -44,9 +45,10 @@
| -- | -- |
| `head` | 列头区域。 |
| `foot` | [^slot-foot] |
| `default` | [^scoped-slot-default] |
| `sub-row` | [^scoped-slot-sub-row] |
| `desc` | [^scoped-slot-desc] |
| `default` | [^slot-default] |
| `sub-row` | [^slot-sub-row] |
| `desc` | [^slot-desc] |
| `filter` | [^slot-filter] |
^^^slot-foot
列脚区域。
@@ -56,7 +58,7 @@
:::
^^^
^^^scoped-slot-default
^^^slot-default
单元格的内容。
默认内容:表格 `data` 数据项中与 `field` 属性对应的字段值。
@@ -64,7 +66,7 @@
作用域参数为 `data` 内当前行数据中的所有字段。
^^^
^^^scoped-slot-sub-row
^^^slot-sub-row
展开行后子行的内容。使用此插槽时,内容会作为行展开下方子行中对应列的单元格内容。行数据源来自 `data` 中对应主行数据的 `children` 数组,展开的子行数与 `children` 内数据项数相同,使用相同的列配置。
默认内容:表格 `data[i].children[j]` 数据项中与 `field` 属性对应的字段值。
@@ -76,6 +78,22 @@
:::
^^^
^^^scoped-slot-desc
表头描述。提供 `close` 函数,用于关闭展现描述内容的容器。使用此插槽时会覆盖 `Column`插槽 `desc` 内容
^^^slot-desc
表头描述。使用此插槽时会覆盖 `Column``desc` 属性
+++作用域参数
| 名称 | 类型 | 描述 |
| -- | -- | -- |
| `close` | `function(): void` | 关闭展现描述内容的容器。 |
+++
^^^
^^^slot-filter
筛选浮层的内容。
+++作用域参数
| 名称 | 类型 | 描述 |
| -- | -- | -- |
| `close` | `function(): void` | 关闭筛选浮层。 |
+++
^^^

View File

@@ -170,9 +170,9 @@
| 名称 | 描述 |
| -- | -- |
| `date` | [^scoped-slot-date] |
| `date` | [^slot-date] |
^^^scoped-slot-date
^^^slot-date
浮层中日历的单日单元格内的区域,可用来定制每一天对应区域的内容。
默认内容:对应日期的 `date`

View File

@@ -100,12 +100,12 @@
| `default` | 选项列表的内容。在没有指定 `options` 属性时,可以用来直接内联 `Option``OptionGroup`。 |
| `before` | 选项列表前的内容。无默认内容。 |
| `after` | 选项列表后的内容。无默认内容。 |
| `label` | [^scoped-slot-label] |
| `group-label` | [^scoped-slot-group-label] |
| `option-label` | [^scoped-slot-option-label] |
| `option` | [^scoped-slot-option] |
| `label` | [^slot-label] |
| `group-label` | [^slot-group-label] |
| `option-label` | [^slot-option-label] |
| `option` | [^slot-option] |
^^^scoped-slot-label
^^^slot-label
下拉按钮文本区域。
默认内容:`label` 属性值。
@@ -117,7 +117,7 @@
+++
^^^
^^^scoped-slot-group-label
^^^slot-group-label
下拉选项组(带 `options` 的选项)的标题文本区域。
默认内容:选项的 `label` 属性值。
@@ -132,7 +132,7 @@
另外,当前选项数据中除了上面描述的字段之外的其它字段也会自动通过 `v-bind` 进行绑定到作用域参数上。
^^^
^^^scoped-slot-option-label
^^^slot-option-label
下拉选项(不带 `options` 的选项)的文本区域。
默认内容:选项的 `label` 属性值。
@@ -148,7 +148,7 @@
另外,当前选项数据中除了上面描述的字段之外的其它字段也会自动通过 `v-bind` 进行绑定到作用域参数上。
^^^
^^^scoped-slot-option
^^^slot-option
可供选择的下拉选项的整个区域。
默认内容:`Option` 内的组件默认结构。

View File

@@ -47,12 +47,12 @@
| 名称 | 描述 |
| -- | -- |
| `default` | 选项列表的内容。在没有指定 `options` 属性时,可以用来直接内联 `Option` 或其它 `OptionGroup` 组件。 |
| `label` | [^scoped-slot-label] |
| `group-label` | [^scoped-slot-group-label] |
| `option-label` | [^scoped-slot-option-label] |
| `option` | [^scoped-slot-option] |
| `label` | [^slot-label] |
| `group-label` | [^slot-group-label] |
| `option-label` | [^slot-option-label] |
| `option` | [^slot-option] |
^^^scoped-slot-label
^^^slot-label
选项组标题文本区域。
默认内容:`label` 属性对应的文本。
@@ -65,7 +65,7 @@
+++
^^^
^^^scoped-slot-group-label
^^^slot-group-label
子选项组的标题文本区域。
默认内容:带 `options` 的选项对应的 `label` 属性值。
@@ -80,7 +80,7 @@
另外,当前选项组数据中除了上面描述的字段之外的其它字段也会自动通过 `v-bind` 进行绑定到作用域参数上。
^^^
^^^scoped-slot-option-label
^^^slot-option-label
选项的文本区域。
默认内容:不带 `options` 的选项对应的 `label` 属性值。
@@ -97,7 +97,7 @@
另外,当前选项数据中除了上面描述的字段之外的其它字段也会自动通过 `v-bind` 进行绑定到作用域参数上。
^^^
^^^scoped-slot-option
^^^slot-option
可供选择的选项的整个区域。
默认内容:`Option` 内的组件默认结构。

View File

@@ -43,9 +43,9 @@
| 名称 | 描述 |
| -- | -- |
| `default` | [^scoped-slot-default] |
| `default` | [^slot-default] |
^^^scoped-slot-default
^^^slot-default
可用来定制文字提示区域的内容。
默认内容:完成率百分比。

View File

@@ -54,9 +54,9 @@
| 名称 | 描述 |
| -- | -- |
| `item` | [^scoped-slot-item] |
| `item` | [^slot-item] |
^^^scoped-slot-item
^^^slot-item
按钮内文本区域。
默认内容:`label` 属性值。

View File

@@ -54,9 +54,9 @@
| 名称 | 描述 |
| -- | -- |
| `item` | [^scoped-slot-item] |
| `item` | [^slot-item] |
^^^scoped-slot-item
^^^slot-item
选项描述文本区域。
默认内容:`label` 属性值。

View File

@@ -41,9 +41,9 @@
| 名称 | 描述 |
| -- | -- |
| `label` | [^scoped-slot-label] |
| `label` | [^slot-label] |
^^^scoped-slot-label
^^^slot-label
每个节点文本描述的内容。
默认内容:每个节点 `label` 字段对应的文本内容。

View File

@@ -59,12 +59,12 @@
| `header-content` | 顶部区域的内容,不包括外层容器。 |
| `shortcuts` | 顶部快捷选项区域。 |
| `legend` | 顶部图例区域。 |
| `legend-label` | [^scoped-slot-legend-label] |
| `hour` | [^scoped-slot-hour] |
| `label` | [^scoped-slot-label] |
| `tooltip` | [^scoped-slot-tooltip] |
| `legend-label` | [^slot-legend-label] |
| `hour` | [^slot-hour] |
| `label` | [^slot-label] |
| `tooltip` | [^slot-tooltip] |
^^^scoped-slot-legend-label
^^^slot-legend-label
每个图例的文本区域。
默认内容:每个图例状态 `label` 字段对应的文本内容。
@@ -79,7 +79,7 @@
另外,`status` 内对应图例状态对象中除了上面描述的字段之外的其它字段也会自动通过 `v-bind` 进行绑定到作用域参数上。
^^^
^^^scoped-slot-hour
^^^slot-hour
每小时区域的内容。
默认内容:无。
@@ -92,7 +92,7 @@
+++
^^^
^^^scoped-slot-label
^^^slot-label
已选时间段的区域。
默认内容:时段在 3 小时及以上时,显示时段范围 <code>&#0096;${from}:00${to + 1}:00&#0096;</code>;选择全天的显示为“全天”;小于 3 小时无内容。
@@ -105,7 +105,7 @@
+++
^^^
^^^scoped-slot-tooltip
^^^slot-tooltip
光标移入每个小时格子的悬浮提示内容。
默认内容:当前小时格子的时间范围 <code>&#0096;${hour}:00${hour + 1}:00&#0096;</code>

View File

@@ -99,12 +99,12 @@
| `default` | 选项列表的内容。在没有指定 `options` 属性时,可以用来直接内联 `Option``OptionGroup`。 |
| `before` | 选项列表前的内容。无默认内容。 |
| `after` | 选项列表后的内容。无默认内容。 |
| `label` | [^scoped-slot-label] |
| `group-label` | [^scoped-slot-group-label] |
| `option-label` | [^scoped-slot-option-label] |
| `option` | [^scoped-slot-option] |
| `label` | [^slot-label] |
| `group-label` | [^slot-group-label] |
| `option-label` | [^slot-option-label] |
| `option` | [^slot-option] |
^^^scoped-slot-label
^^^slot-label
下拉按钮文本区域。
默认内容:已选项对应的 `label` 属性值或内联模式下已选项的文本内容。
@@ -121,7 +121,7 @@
另外,当前选项数据中除了上面描述的字段之外的其它字段也会自动通过 `v-bind` 进行绑定到作用域参数上。
^^^
^^^scoped-slot-group-label
^^^slot-group-label
下拉选项组(带 `options` 的选项)的标题文本区域。
默认内容:选项的 `label` 属性值。
@@ -136,7 +136,7 @@
另外,当前选项数据中除了上面描述的字段之外的其它字段也会自动通过 `v-bind` 进行绑定到作用域参数上。
^^^
^^^scoped-slot-option-label
^^^slot-option-label
下拉选项(不带 `options` 的选项)的文本区域。
默认内容:选项的 `label` 属性值。
@@ -153,7 +153,7 @@
另外,当前选项数据中除了上面描述的字段之外的其它字段也会自动通过 `v-bind` 进行绑定到作用域参数上。
^^^
^^^scoped-slot-option
^^^slot-option
可供选择的下拉选项的整个区域。
默认内容:`Option` 内的组件默认结构。

View File

@@ -82,10 +82,10 @@
| -- | -- |
| `track` | 滑轨。默认内容:横线。 |
| `tip-label` | 浮动提示文本。默认内容:当前 `value` 值。 |
| `thumb` | [^scoped-slot-thumb] |
| `tip` | [^scoped-slot-tip] |
| `thumb` | [^slot-thumb] |
| `tip` | [^slot-tip] |
^^^scoped-slot-thumb
^^^slot-thumb
滑块。
默认内容:圆形按钮。
@@ -100,7 +100,7 @@
+++
^^^
^^^scoped-slot-tip
^^^slot-tip
浮动提示。
默认内容:内容为 `value` 的 Tooltip 组件。

View File

@@ -54,12 +54,12 @@
| 名称 | 描述 |
| -- | -- |
| `default` | [^scoped-slot-default] |
| `default` | [^slot-default] |
| `index` | 序号部分内容,默认显示从 `1` 开始的序号,已完成的步骤显示完成图标,出错的步骤显示出错图标。位于 `default` 内部,作用域参数同 `default`。 |
| `label` | 步骤标题部分内容,默认显示 `steps` 中项目的 `label` 字段。位于 `default` 内部,作用域参数同 `default`。 |
| `desc` | 步骤描述部分内容,默认显示 `steps` 中项目的 `desc` 字段。位于 `default` 内部,作用域参数同 `default`。 |
^^^scoped-slot-default
^^^slot-default
整个步骤项内容。
默认内容:序号/完成图标、步骤标题、描述等内容。

View File

@@ -97,9 +97,9 @@
| `default` | 用于定义表格列,只能包含 `Column` 组件。 |
| `no-data` | 用于定义无数据时要展现的内容。 |
| `foot` | 表格脚部内容,整个区域将打通成为一个容器,不再保留分列。 |
| `sub-row` | [^scoped-slot-sub-row] |
| `sub-row` | [^slot-sub-row] |
^^^scoped-slot-sub-row
^^^slot-sub-row
展开行后子行的内容。使用此插槽时,内容会作为行展开下方通栏显式的子行内容。使用此插槽时会覆盖 `Column` 的插槽 `sub-row` 内容。
作用域参数为 `data` 内当前行数据中的所有字段,以及当前行对应索引值 `index`

View File

@@ -72,9 +72,9 @@
| 名称 | 描述 |
| -- | -- |
| `option` | [^scoped-slot-option] |
| `option` | [^slot-option] |
^^^scoped-slot-option
^^^slot-option
下拉面板中的时间选项插槽。