From edb6ea8858cb52312df56b71300710bbe3c6363e Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 2 Jul 2021 10:21:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(Area):=20add=20toolbar=E3=80=81confirm?= =?UTF-8?q?=E3=80=81cancel=20slots=20(#8969)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/area/Area.tsx | 31 ++++++++++++++++++++----------- src/area/README.md | 13 ++++++++----- src/area/README.zh-CN.md | 13 ++++++++----- 3 files changed, 36 insertions(+), 21 deletions(-) diff --git a/src/area/Area.tsx b/src/area/Area.tsx index 43243d25e..bb4faae93 100644 --- a/src/area/Area.tsx +++ b/src/area/Area.tsx @@ -24,6 +24,24 @@ import { Picker } from '../picker'; const [name, bem] = createNamespace('area'); const EMPTY_CODE = '000000'; +const INHERIT_SLOTS = [ + 'title', + 'cancel', + 'confirm', + 'toolbar', + 'columns-top', + 'columns-bottom', +] as const; +const INHERIT_PROPS = [ + 'title', + 'loading', + 'readonly', + 'itemHeight', + 'swipeDuration', + 'visibleItemCount', + 'cancelButtonText', + 'confirmButtonText', +] as const; function isOverseaCode(code: string) { return code[0] === '9'; @@ -305,23 +323,14 @@ export default defineComponent({ return ( ); }; diff --git a/src/area/README.md b/src/area/README.md index d79bbdd77..4556f8c98 100644 --- a/src/area/README.md +++ b/src/area/README.md @@ -147,11 +147,14 @@ An array that contains selected area objects. ### Slots -| Name | Description | -| -------------- | ---------------------------- | -| title | Custom title | -| columns-top | Custom content above columns | -| columns-bottom | Custom content below columns | +| Name | Description | SlotProps | +| --------------- | ---------------------------- | --------- | +| toolbar `3.1.2` | Custom toolbar content | - | +| title | Custom title | - | +| confirm `3.1.2` | Custom confirm button text | - | +| cancel `3.1.2` | Custom cancel button text | - | +| columns-top | Custom content above columns | - | +| columns-bottom | Custom content below columns | - | ### Methods diff --git a/src/area/README.zh-CN.md b/src/area/README.zh-CN.md index fcc2ab3e6..3f64c2c44 100644 --- a/src/area/README.zh-CN.md +++ b/src/area/README.zh-CN.md @@ -149,11 +149,14 @@ confirm 事件返回的数据整体为一个数组,数组每一项对应一列 ### Slots -| 名称 | 说明 | -| -------------- | ------------------ | -| title | 自定义标题内容 | -| columns-top | 自定义选项上方内容 | -| columns-bottom | 自定义选项下方内容 | +| 名称 | 说明 | 参数 | +| ---------------- | ---------------------- | ---- | +| toolbar `v3.1.2` | 自定义整个顶部栏的内容 | - | +| title | 自定义标题内容 | - | +| confirm `v3.1.2` | 自定义确认按钮内容 | - | +| cancel `v3.1.2` | 自定义取消按钮内容 | - | +| columns-top | 自定义选项上方内容 | - | +| columns-bottom | 自定义选项下方内容 | - | ### 方法