| | |
| | | } |
| | | ``` |
| | | |
| | | ## 用法 |
| | | ## 代码演示 |
| | | |
| | | <a href="https://developers.weixin.qq.com/s/T58agimj75SB" title="在开发者工具中预览效果" target="_blank" rel="noopener noreferrer"> 在开发者工具中预览效果 </a> |
| | | |
| | | <blockquote style="background-color: #d9e1ff; font-size: 15px; line-height: 26px;margin: 16px 0 0;padding: 16px; border-radius: 6px; color: #0052d9" > |
| | | <p>Tips: 请确保开发者工具为打开状态。导入开发者工具后,依次执行:npm i > 构建npm包 > 勾选 "将JS编译成ES5"</p> |
| | | </blockquote> |
| | | |
| | | ### 单选下拉菜单 |
| | | |
| | |
| | | |
| | | 名称 | 类型 | 默认值 | 说明 | 必传 |
| | | -- | -- | -- | -- | -- |
| | | arrow-icon | String / Object | 'caret-down-small' | 自定义箭头图标 | N |
| | | close-on-click-overlay | Boolean | true | 是否在点击遮罩层后关闭菜单 | N |
| | | duration | String / Number | 200 | 动画时长 | N |
| | | external-classes | Array | - | 组件类名,分别用于设置 组件外层类名、菜单标签、菜单图标类名 等。`['t-class', 't-class-item', 't-class-label', 't-class-icon']` | N |
| | | show-overlay | Boolean | true | 是否显示遮罩层 | N |
| | | z-index | Number | 11600 | 菜单栏 z-index 层级 | N |
| | | |
| | | ### DropdownMenu Events |
| | | |
| | | 名称 | 参数 | 描述 |
| | | -- | -- | -- |
| | | open | \- | 菜单展开时触发 |
| | | close | \- | 菜单关闭时触发 |
| | | |
| | | ### DropdownMenu 外部样式类 |
| | | 类名 | 说明 |
| | | -- | -- |
| | | t-class | 根节点样式类 |
| | | t-class-item | 选项样式类 |
| | | t-class-label | 标签样式类 |
| | | t-class-icon | 图标样式类 |
| | | |
| | | ### DropdownItem Props |
| | | |
| | | 名称 | 类型 | 默认值 | 说明 | 必传 |
| | | -- | -- | -- | -- | -- |
| | | disabled | Boolean | false | 是否禁用 | N |
| | | external-classes | Array | - | 组件类名,分别用于设置 组件外层类名、菜单列、菜单列选项、菜单列选项标签、树形菜单、树形菜单列等类名。`['t-class','t-class-content', 't-class-column', 't-class-column-item', 't-class-column-item-label', 't-class-footer']` | N |
| | | keys | Object | - | 用来定义 value / label 在 `options` 中对应的字段别名。TS 类型:`KeysType` | N |
| | | label | String | - | 标题 | N |
| | | multiple | Boolean | false | 是否多选 | N |
| | |
| | | -- | -- | -- |
| | | change | `(value: DropdownValue)` | 值改变时触发 |
| | | confirm | `(value: DropdownValue)` | 点击确认时触发 |
| | | reset | - | 点击重置时触发 |
| | | reset | \- | 点击重置时触发 |
| | | close | \- | 关闭时触发 |
| | | |
| | | ### DropdownItem 外部样式类 |
| | | 类名 | 说明 |
| | | -- | -- |
| | | t-class | 根节点样式类 |
| | | t-class-content | 内容样式类 |
| | | t-class-column | 菜单列样式类 |
| | | t-class-column-item | 菜单列选项样式类 |
| | | t-class-column-item-label | 菜单列选项标签样式类 |
| | | t-class-footer | 底部样式类 |
| | | |
| | | ### CSS 变量 |
| | | 组件提供了下列 CSS 变量,可用于自定义样式。 |
| | | 名称 | 默认值 | 描述 |
| | | -- | -- | -- |
| | | --td-dropdown-menu-active-colorm | @brand-color | - |
| | | --td-dropdown-menu-bg-colorm | @bg-color-container | - |
| | | --td-dropdown-menu-border-width | 1px | - |
| | | --td-dropdown-menu-colorm | @font-gray-1 | - |
| | | --td-dropdown-menu-disabled-colorm | @font-gray-4 | - |
| | | --td-dropdown-menu-font-sizem | 28rpx | - |
| | | --td-dropdown-menu-icon-sizem | 48rpx | - |
| | | --td-dropdown-body-max-height | 560rpx | - |
| | | --td-dropdown-menu-bg-color | @bg-color-container | - |
| | | --td-tree-bg-color | @bg-color-container | - |
| | | --td-tree-item-active-color | @brand-color | - |
| | | --td-tree-item-font-size | 32rpx | - |
| | | --td-tree-item-height | 96rpx | - |
| | | --td-tree-root-bg-color | @bg-color-secondarycontainer | - |