diff --git a/packages/devui-vue/devui/button/src/button-types.ts b/packages/devui-vue/devui/button/src/button-types.ts index 2c09d2a67a7acba6e928302bbefdd4776d1dce3e..e0e117e309952731704411b0d91d4589eff32917 100644 --- a/packages/devui-vue/devui/button/src/button-types.ts +++ b/packages/devui-vue/devui/button/src/button-types.ts @@ -1,7 +1,7 @@ import { ExtractPropTypes, PropType } from 'vue'; export type IButtonType = 'button' | 'submit' | 'reset'; -export type IButtonStyle = 'common' | 'primary' | 'text' | 'text-dark' | 'danger'; +export type IButtonStyle = 'common' | 'primary' | 'text' | 'text-dark' | 'danger' | 'success' | 'warning'; export type IButtonPosition = 'left' | 'right' | 'default'; export type IButtonSize = 'lg' | 'md' | 'sm' | 'xs'; diff --git a/packages/devui-vue/devui/button/src/button.scss b/packages/devui-vue/devui/button/src/button.scss index 1577e7abb8ba12e1b98083926dbc562cc86ab710..eb1415eb01f912bb1f05570ab8369b7d21cd6eb2 100644 --- a/packages/devui-vue/devui/button/src/button.scss +++ b/packages/devui-vue/devui/button/src/button.scss @@ -56,6 +56,16 @@ $devui-btn-normal-config: ( min-width: $devui-btn-min-width, background-color: $devui-contrast ), + success: ( + color: $devui-dark-text, + min-width: $devui-btn-min-width, + background-color: $devui-success + ), + warning: ( + color: $devui-dark-text, + min-width: $devui-btn-min-width, + background-color: $devui-warning + ), xs: ( padding: $devui-btn-xs-padding, height: $devui-btn-xs-height, @@ -160,6 +170,28 @@ $devui-btn-pseudo-config: ( active: ( background-color: $devui-contrast-active ) + ), + success: ( + hover: ( + background-color: $devui-success-hover + ), + focus: ( + background-color: $devui-success-hover + ), + active: ( + background-color: $devui-success-active + ) + ), + warning: ( + hover: ( + background-color: $devui-warning-hover + ), + focus: ( + background-color: $devui-warning-hover + ), + active: ( + background-color: $devui-warning-active + ) ) ); @@ -172,14 +204,14 @@ $devui-btn-pseudo-config: ( border-width: 1px; border-color: transparent; background-color: transparent; - @each $type in text, text-dark, common, stress, primary, danger, left, right, xs, sm, lg { + @each $type in text, text-dark, common, stress, primary, danger, success, warning, left, right, xs, sm, lg { &.devui-btn-#{$type} { @each $key, $value in map-get($devui-btn-normal-config, $type) { #{$key}: $value; } } } - @each $type in text, text-dark, common, stress, primary, danger { + @each $type in text, text-dark, common, stress, primary, danger, success, warning, { &.devui-btn-#{$type} { @each $pseudo, $value in map-get($devui-btn-pseudo-config, $type) { &:#{$pseudo} { diff --git a/packages/devui-vue/devui/style/theme/_color.scss b/packages/devui-vue/devui/style/theme/_color.scss index 3245ca181f88a7f63507ab347f49cc7e65710904..307debe65c7d83a20edaf2810285f11feb059365 100755 --- a/packages/devui-vue/devui/style/theme/_color.scss +++ b/packages/devui-vue/devui/style/theme/_color.scss @@ -26,8 +26,14 @@ $devui-block: var(--devui-block, #ffffff); // 大面 $devui-area: var(--devui-area, #f8f8f8); // 可折叠区块的背景色(展开区域颜色) $devui-danger: var(--devui-danger, #f66f6a); // 失败、错误、告警 $devui-warning: var(--devui-warning, #fac20a); // 警告、需注意类型提示 +$devui-warning-hover: var(--devui-warning, #fac20a); // 警告、需注意类型提示 +$devui-warning-active: var(--devui-warning, #fac20a); +$devui-warning-active-focus: var(--devui-warning, #fac20a); $devui-waiting: var(--devui-waiting, #9faad7); // 等待中 $devui-success: var(--devui-success, #50d4ab); // 成功、正确 +$devui-success-hover: var(--devui-warning, #50d4ab); // 成功、 +$devui-success-active: var(--devui-warning, #50d4ab); +$devui-success-active-focus: var(--devui-warning, #50d4ab); $devui-info: var(--devui-info, #5e7ce0); // 通知、一般提示、执行中 $devui-initial: var(--devui-initial, #e9edfa); // 初始化、未执行 $devui-unavailable: var(--devui-unavailable, #f5f5f6); // 不可用、禁用状态 diff --git a/packages/devui-vue/docs/components/button/index.md b/packages/devui-vue/docs/components/button/index.md index 3aa254acc163735d6d6e27b5c5b168b9b3259832..6129b78431137e66ff34c6d893457c107014dfce 100644 --- a/packages/devui-vue/docs/components/button/index.md +++ b/packages/devui-vue/docs/components/button/index.md @@ -51,6 +51,23 @@ ``` ::: +### 警示按钮 +用于标识系统中的关键操作,例如购买场景。 +:::demo +```vue + +``` +::: + ### 文字按钮 用于标识系统中的关键操作,例如购买场景。 :::demo @@ -89,51 +106,44 @@ :::demo ```vue