From 6d0ce3f81baba86f11664fcdfa1d4e47953c2cbc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8F=9C=E5=BE=97=E8=AE=A9=E4=BA=BA=E5=8F=91=E6=AF=9B?=
<2328204591@qq.com>
Date: Fri, 29 Aug 2025 17:27:37 +0800
Subject: [PATCH 1/2] =?UTF-8?q?feat(doc):=20=E8=A1=A5=E5=85=85ODropdown?=
=?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=96=87=E6=A1=A3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../__docs__/__case__/DropdownAsTheme.vue | 81 +++++++++++++++++++
.../__docs__/__case__/DropdownNormal.vue | 79 ++++++++++++++++++
.../__docs__/__case__/DropdownPrimary.vue | 80 ++++++++++++++++++
.../__docs__/__case__/DropdownText.vue | 78 ++++++++++++++++++
.../src/dropdown/__docs__/index.en-US.md | 6 ++
.../src/dropdown/__docs__/index.zh-CN.md | 6 ++
packages/opendesign/src/dropdown/types.ts | 49 +++++++----
7 files changed, 364 insertions(+), 15 deletions(-)
create mode 100644 packages/opendesign/src/dropdown/__docs__/__case__/DropdownAsTheme.vue
create mode 100644 packages/opendesign/src/dropdown/__docs__/__case__/DropdownNormal.vue
create mode 100644 packages/opendesign/src/dropdown/__docs__/__case__/DropdownPrimary.vue
create mode 100644 packages/opendesign/src/dropdown/__docs__/__case__/DropdownText.vue
diff --git a/packages/opendesign/src/dropdown/__docs__/__case__/DropdownAsTheme.vue b/packages/opendesign/src/dropdown/__docs__/__case__/DropdownAsTheme.vue
new file mode 100644
index 00000000..862dc23b
--- /dev/null
+++ b/packages/opendesign/src/dropdown/__docs__/__case__/DropdownAsTheme.vue
@@ -0,0 +1,81 @@
+
+
+
+#### 运营按钮
+
+- **配置方式**:为按钮组件添加类名 `c-btn-activity` 或 `c-btn-ascend`(二选一)
+
+
+
+#### Operational Buttons
+
+- **Configuration Method**: Add either the class name `c-btn-activity` or `c-btn-ascend` (choose one) to the button component.
+
+
+
+
+
+
+
+ 下拉按钮
+
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
diff --git a/packages/opendesign/src/dropdown/__docs__/__case__/DropdownNormal.vue b/packages/opendesign/src/dropdown/__docs__/__case__/DropdownNormal.vue
new file mode 100644
index 00000000..e5365205
--- /dev/null
+++ b/packages/opendesign/src/dropdown/__docs__/__case__/DropdownNormal.vue
@@ -0,0 +1,79 @@
+
+
+
+#### 普通按钮
+
+- **配置方式**:需同时传递两个参数
+ `color="primary"`(标识颜色为主题色) + `variant="outline"`(线框样式)
+
+
+
+#### Normal Buttons
+
+- **Configuration Method**: Requires passing two parameters simultaneously:
+ `color="primary"` (indicates the color as the theme color) + `variant="outline"` (outline style).
+
+
+
+
+
+
+
+ 下拉按钮
+
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
diff --git a/packages/opendesign/src/dropdown/__docs__/__case__/DropdownPrimary.vue b/packages/opendesign/src/dropdown/__docs__/__case__/DropdownPrimary.vue
new file mode 100644
index 00000000..1f1eeb92
--- /dev/null
+++ b/packages/opendesign/src/dropdown/__docs__/__case__/DropdownPrimary.vue
@@ -0,0 +1,80 @@
+
+
+
+#### 强调按钮
+
+- **配置方式**:需同时传递两个参数
+ `color="primary"`(标识颜色为主题色) + `variant="solid"`(实心样式)
+- **下拉禁用**:需给 `OButton` 传递 `disabled` 属性,并同时给 `ODropdown` 传递 `trigger="none"` 属性
+
+
+#### Primary Buttons (Main Action Buttons)
+
+- **Configuration Method**: Requires passing two parameters simultaneously:
+ `color="primary"` (indicates the color as the theme color) + `variant="solid"` (solid style).
+- **Dropdown disabled**:The 'disabled' attribute needs to be passed to `OButton`, and at the same time, the 'trigger="none"' attribute should be passed to `ODropdown`.
+
+
+
+
+
+
+
+ 下拉按钮
+
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
diff --git a/packages/opendesign/src/dropdown/__docs__/__case__/DropdownText.vue b/packages/opendesign/src/dropdown/__docs__/__case__/DropdownText.vue
new file mode 100644
index 00000000..dc6001c4
--- /dev/null
+++ b/packages/opendesign/src/dropdown/__docs__/__case__/DropdownText.vue
@@ -0,0 +1,78 @@
+
+
+
+#### 文本按钮
+
+- **基础组件**:使用 `OLink` 组件实现
+- **下拉禁用**:需给 `OLink` 传递 `disabled` 属性,并同时给 `ODropdown` 传递 `trigger="none"` 属性
+
+
+#### Text Buttons
+
+- **Base Component**: Implemented using the `OLink` component.
+- **Dropdown disabled**:The 'disabled' attribute needs to be passed to `OLink`, and at the same time, the 'trigger="none"' attribute should be passed to `ODropdown`.
+
+
+
+
+
+
+
+ 下拉按钮
+
+
+
+
+
+
+ {{ item.label }}
+
+
+
+
+
+
+
diff --git a/packages/opendesign/src/dropdown/__docs__/index.en-US.md b/packages/opendesign/src/dropdown/__docs__/index.en-US.md
index 6bb278f6..21ace16b 100644
--- a/packages/opendesign/src/dropdown/__docs__/index.en-US.md
+++ b/packages/opendesign/src/dropdown/__docs__/index.en-US.md
@@ -8,6 +8,12 @@ sidebar: ODropdown
+
+
+
+
+
## Api
+
diff --git a/packages/opendesign/src/dropdown/__docs__/index.zh-CN.md b/packages/opendesign/src/dropdown/__docs__/index.zh-CN.md
index c12f2f1c..87bf2035 100644
--- a/packages/opendesign/src/dropdown/__docs__/index.zh-CN.md
+++ b/packages/opendesign/src/dropdown/__docs__/index.zh-CN.md
@@ -8,6 +8,12 @@ sidebar: ODropdown 下拉
+
+
+
+
+
## Api
+
diff --git a/packages/opendesign/src/dropdown/types.ts b/packages/opendesign/src/dropdown/types.ts
index d98d99f3..e745a345 100644
--- a/packages/opendesign/src/dropdown/types.ts
+++ b/packages/opendesign/src/dropdown/types.ts
@@ -4,74 +4,90 @@ import type { SizeT, RoundT } from '../_utils/types';
export const dropdownProps = {
/**
- * 弹出框是否可见
+ * @zh-CN 弹出框是否可见
+ * @en-US Is the pop-up box visible
*/
visible: {
type: Boolean,
},
/**
- * 非受控模式,弹出框是否默认可见
+ * @zh-CN 非受控模式,弹出框是否默认可见
+ * @en-US In uncontrolled mode, is the pop-up box visible by default
+ * @default false
*/
defaultVisible: {
type: Boolean,
default: false,
},
/**
- * 大小 SizeT
+ * @zh-CN 大小
+ * @en-US Size
*/
size: {
type: String as PropType,
},
/**
- * 圆角值 RoundT
+ * @zh-CN 圆角值
+ * @en-US Round
*/
round: {
type: String as PropType,
},
/**
- * 下拉选项触发方式 PopupTriggerT
+ * @zh-CN 下拉选项触发方式
+ * @en-US The triggering method of the drop-down option
+ * @default 'click'
*/
trigger: {
type: String as PropType,
default: 'click',
},
/**
- * 下拉选项位置 PopupPositionT
+ * @zh-CN 下拉选项位置
+ * @en-US Drop-down option position
+ * @default 'bl'
*/
optionPosition: {
type: String as PropType,
default: 'bl',
},
/**
- * 下拉选项宽度自适应规则
- * 'auto':自动 | 'min-width':最小宽度与选择框一致 | 'width': 宽度与选择框一致
+ * @zh-CN 下拉选项宽度自适应规则 'auto':自动 | 'min-width':最小宽度与选择框一致 | 'width': 宽度与选择框一致
+ * @en-US Drop-down option width adaptation rules: 'auto': automatic; 'min-width': minimum width consistent with the selection box; 'width': width consistent with the selection box
+ * @default 'min-width'
*/
optionWidthMode: {
type: String as PropType<'auto' | 'min-width' | 'width'>,
default: 'min-width',
},
/**
- * 挂载容器,默认为body
+ * @zh-CN 挂载容器,默认为body
+ * @en-US Mount the container, with the default being body
+ * @default 'body'
*/
optionsWrapper: {
type: [String, Object] as PropType,
default: 'body',
},
/**
- * 下拉容器自定义类
+ * @zh-CN 下拉容器自定义类
+ * @en-US Drop-down container custom class
*/
optionWrapClass: {
type: [String, Array] as PropType,
},
/**
- * 是否在结束选择时,卸载下拉选项
+ * @zh-CN 是否在结束选择时,卸载下拉选项
+ * @en-US Whether to uninstall the drop-down options when ending the selection
+ * @default true
*/
unmountOnHide: {
type: Boolean,
default: true,
},
/**
- * 过渡名称
+ * @zh-CN 过渡名称
+ * @en-US Transitional name
*/
transition: {
type: String,
@@ -82,21 +98,24 @@ export type DropdownPropsT = ExtractPropTypes;
export const dropdownItemProps = {
/**
- * 显示文本
+ * @zh-CN 选项显示文本
+ * @en-US The option displays text.
*/
label: {
type: String,
default: '',
},
/**
- * 选项值
+ * @zh-CN 选项选中值
+ * @en-US Selected value of the option
*/
value: {
type: [String, Number] as PropType,
default: '',
},
/**
- * 是否禁用
+ * @zh-CN 是否禁用
+ * @en-US Whether to disable
*/
disabled: {
type: Boolean,
--
Gitee
From 9699d6067721ad6baea7796648e404e9d3510d81 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8F=9C=E5=BE=97=E8=AE=A9=E4=BA=BA=E5=8F=91=E6=AF=9B?=
<2328204591@qq.com>
Date: Mon, 1 Sep 2025 15:14:55 +0800
Subject: [PATCH 2/2] =?UTF-8?q?feat(doc):=20=E8=A1=A5=E5=85=85ODropdown?=
=?UTF-8?q?=E7=BB=84=E4=BB=B6=E6=96=87=E6=A1=A3=E7=9A=84=E7=9A=AE=E8=82=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../__docs__/__case__/DropdownAsTheme.vue | 6 ++--
.../__docs__/__case__/DropdownNormal.vue | 6 ++--
.../__docs__/__case__/DropdownPrimary.vue | 6 ++--
.../__docs__/__case__/DropdownText.vue | 4 ++-
.../opendesign/src/dropdown/style/common.scss | 31 +++++++++++++++++++
.../src/dropdown/style/theme-ascend.scss | 15 +++++++++
.../src/dropdown/style/theme-kunpeng.scss | 1 +
.../src/dropdown/style/theme-openeuler.scss | 1 +
8 files changed, 60 insertions(+), 10 deletions(-)
create mode 100644 packages/opendesign/src/dropdown/style/common.scss
diff --git a/packages/opendesign/src/dropdown/__docs__/__case__/DropdownAsTheme.vue b/packages/opendesign/src/dropdown/__docs__/__case__/DropdownAsTheme.vue
index 862dc23b..7202e3a7 100644
--- a/packages/opendesign/src/dropdown/__docs__/__case__/DropdownAsTheme.vue
+++ b/packages/opendesign/src/dropdown/__docs__/__case__/DropdownAsTheme.vue
@@ -3,13 +3,13 @@
#### 运营按钮
-- **配置方式**:为按钮组件添加类名 `c-btn-activity` 或 `c-btn-ascend`(二选一)
+- **配置方式**:为按钮组件添加类名 `c-btn-activity` 或 `c-btn-ascend`(二选一),同时为 `ODropdown` 组件添加类名 `o-dropdwon-btn-wrap`
#### Operational Buttons
-- **Configuration Method**: Add either the class name `c-btn-activity` or `c-btn-ascend` (choose one) to the button component.
+- **Configuration Method**: Add the class name 'c-btn-activity' or 'c-btn-ascend' (choose one) to the `OButton` component, and add the class name 'o-dropdwon-btn-wrap' to the `ODropdown` component at the same time.