From 2dd21449b50dde7ab1af1716809621aa62b6a3e3 Mon Sep 17 00:00:00 2001 From: liweijie0812 <674416404@qq.com> Date: Thu, 29 Aug 2024 12:17:18 +0800 Subject: [PATCH] docs(DropdownMenu): footer api (#1551) --- src/dropdown-menu/dropdown-item-props.ts | 6 +++++- src/dropdown-menu/dropdown-menu.en-US.md | 9 ++++++--- src/dropdown-menu/dropdown-menu.md | 13 ++++++++----- src/dropdown-menu/type.ts | 8 ++++++-- 4 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/dropdown-menu/dropdown-item-props.ts b/src/dropdown-menu/dropdown-item-props.ts index 0c7b56938..35167d8a3 100644 --- a/src/dropdown-menu/dropdown-item-props.ts +++ b/src/dropdown-menu/dropdown-item-props.ts @@ -8,8 +8,12 @@ import { TdDropdownItemProps } from '../dropdown-menu/type'; import { PropType } from 'vue'; export default { - /** 是否禁用 */ + /** 是否禁用操作项 */ disabled: Boolean, + /** 底部 */ + footer: { + type: Function as PropType, + }, /** 用来定义 value / label 在 `options` 中对应的字段别名 */ keys: { type: Object as PropType, diff --git a/src/dropdown-menu/dropdown-menu.en-US.md b/src/dropdown-menu/dropdown-menu.en-US.md index 9af08b1ee..ac2a46597 100644 --- a/src/dropdown-menu/dropdown-menu.en-US.md +++ b/src/dropdown-menu/dropdown-menu.en-US.md @@ -1,21 +1,24 @@ :: BASE_DOC :: ## API + ### DropdownMenu Props name | type | default | description | required -- | -- | -- | -- | -- closeOnClickOverlay | Boolean | true | \- | N -direction | String | down | options:down/up | N +direction | String | down | options: down/up | N duration | String / Number | 200 | \- | N showOverlay | Boolean | true | \- | N zIndex | Number | 11600 | \- | N + ### DropdownItem Props name | type | default | description | required -- | -- | -- | -- | -- disabled | Boolean | false | \- | N +footer | Slot / Function | - | Typescript:`TNode`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N keys | Object | - | Typescript:`KeysType`。[see more ts definition](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N label | String | - | \- | N multiple | Boolean | false | \- | N @@ -35,8 +38,8 @@ change | `(value: DropdownValue)` | \- confirm | `(value: DropdownValue)` | \- reset | `(value: DropdownValue)` | \- - ### CSS Variables + The component provides the following CSS variables, which can be used to customize styles. Name | Default Value | Description -- | -- | -- @@ -47,4 +50,4 @@ Name | Default Value | Description --td-dropdown-menu-colorm | @font-gray-1 | - --td-dropdown-menu-disabled-colorm | @font-gray-4 | - --td-dropdown-menu-font-sizem | 14px | - ---td-dropdown-menu-icon-sizem | 24px | - +--td-dropdown-menu-icon-sizem | 24px | - \ No newline at end of file diff --git a/src/dropdown-menu/dropdown-menu.md b/src/dropdown-menu/dropdown-menu.md index 5ad167605..67e6a39a2 100644 --- a/src/dropdown-menu/dropdown-menu.md +++ b/src/dropdown-menu/dropdown-menu.md @@ -1,9 +1,10 @@ :: BASE_DOC :: ## API + ### DropdownMenu Props -名称 | 类型 | 默认值 | 说明 | 必传 +名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- closeOnClickOverlay | Boolean | true | 是否在点击遮罩层后关闭菜单 | N direction | String | down | 菜单展开方向。可选项:down/up | N @@ -11,11 +12,13 @@ duration | String / Number | 200 | 动画时长 | N showOverlay | Boolean | true | 是否显示遮罩层 | N zIndex | Number | 11600 | 菜单栏 z-index 层级 | N + ### DropdownItem Props -名称 | 类型 | 默认值 | 说明 | 必传 +名称 | 类型 | 默认值 | 描述 | 必传 -- | -- | -- | -- | -- -disabled | Boolean | false | 是否禁用 | N +disabled | Boolean | false | 是否禁用操作项 | N +footer | Slot / Function | - | 底部。TS 类型:`TNode`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N keys | Object | - | 用来定义 value / label 在 `options` 中对应的字段别名。TS 类型:`KeysType`。[通用类型定义](https://github.com/Tencent/tdesign-mobile-vue/blob/develop/src/common.ts) | N label | String | - | 标题 | N multiple | Boolean | false | 是否多选 | N @@ -35,8 +38,8 @@ change | `(value: DropdownValue)` | 值改变时触发 confirm | `(value: DropdownValue)` | 点击确认时触发 reset | `(value: DropdownValue)` | 点击重置时触发 - ### CSS Variables + 组件提供了下列 CSS 变量,可用于自定义样式。 名称 | 默认值 | 描述 -- | -- | -- @@ -47,4 +50,4 @@ reset | `(value: DropdownValue)` | 点击重置时触发 --td-dropdown-menu-colorm | @font-gray-1 | - --td-dropdown-menu-disabled-colorm | @font-gray-4 | - --td-dropdown-menu-font-sizem | 14px | - ---td-dropdown-menu-icon-sizem | 24px | - +--td-dropdown-menu-icon-sizem | 24px | - \ No newline at end of file diff --git a/src/dropdown-menu/type.ts b/src/dropdown-menu/type.ts index 79bfc03ef..9ce1ea80d 100644 --- a/src/dropdown-menu/type.ts +++ b/src/dropdown-menu/type.ts @@ -4,7 +4,7 @@ * 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC * */ -import { KeysType } from '../common'; +import { TNode, KeysType } from '../common'; export interface TdDropdownMenuProps { /** @@ -36,10 +36,14 @@ export interface TdDropdownMenuProps { export interface TdDropdownItemProps { /** - * 是否禁用 + * 是否禁用操作项 * @default false */ disabled?: boolean; + /** + * 底部 + */ + footer?: TNode; /** * 用来定义 value / label 在 `options` 中对应的字段别名 */