Skip to content

Commit

Permalink
docs(DropdownMenu): footer api (#1551)
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 authored Aug 29, 2024
1 parent 8c7adde commit 2dd2144
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
6 changes: 5 additions & 1 deletion src/dropdown-menu/dropdown-item-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ import { TdDropdownItemProps } from '../dropdown-menu/type';
import { PropType } from 'vue';

export default {
/** 是否禁用 */
/** 是否禁用操作项 */
disabled: Boolean,
/** 底部 */
footer: {
type: Function as PropType<TdDropdownItemProps['footer']>,
},
/** 用来定义 value / label 在 `options` 中对应的字段别名 */
keys: {
type: Object as PropType<TdDropdownItemProps['keys']>,
Expand Down
9 changes: 6 additions & 3 deletions src/dropdown-menu/dropdown-menu.en-US.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
:: BASE_DOC ::

## API

### DropdownMenu Props

name | type | default | description | required
-- | -- | -- | -- | --
closeOnClickOverlay | Boolean | true | \- | N
direction | String | down | optionsdown/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
Expand All @@ -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
-- | -- | --
Expand All @@ -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 | -
13 changes: 8 additions & 5 deletions src/dropdown-menu/dropdown-menu.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
:: BASE_DOC ::

## API

### DropdownMenu Props

名称 | 类型 | 默认值 | 说明 | 必传
名称 | 类型 | 默认值 | 描述 | 必传
-- | -- | -- | -- | --
closeOnClickOverlay | Boolean | true | 是否在点击遮罩层后关闭菜单 | N
direction | String | down | 菜单展开方向。可选项:down/up | N
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
Expand All @@ -35,8 +38,8 @@ change | `(value: DropdownValue)` | 值改变时触发
confirm | `(value: DropdownValue)` | 点击确认时触发
reset | `(value: DropdownValue)` | 点击重置时触发


### CSS Variables

组件提供了下列 CSS 变量,可用于自定义样式。
名称 | 默认值 | 描述
-- | -- | --
Expand All @@ -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 | -
8 changes: 6 additions & 2 deletions src/dropdown-menu/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* 该文件为脚本自动生成文件,请勿随意修改。如需修改请联系 PMC
* */

import { KeysType } from '../common';
import { TNode, KeysType } from '../common';

export interface TdDropdownMenuProps {
/**
Expand Down Expand Up @@ -36,10 +36,14 @@ export interface TdDropdownMenuProps {

export interface TdDropdownItemProps {
/**
* 是否禁用
* 是否禁用操作项
* @default false
*/
disabled?: boolean;
/**
* 底部
*/
footer?: TNode;
/**
* 用来定义 value / label 在 `options` 中对应的字段别名
*/
Expand Down

0 comments on commit 2dd2144

Please sign in to comment.