From 9ad8b2edd8193f975c3f4b994a2816821c7f57cd Mon Sep 17 00:00:00 2001 From: 2113ic Date: Fri, 22 Mar 2024 21:36:51 +0800 Subject: [PATCH 01/18] fix(button): simplify class names --- .../components/button/src/button.vue | 48 ++--- .../components/button/src/utils.ts | 16 -- .../components/button/style/css.ts | 2 - .../components/button/style/index.less | 196 ++++++++---------- .../components/button/style/index.ts | 1 + .../components/button/style/variables.less | 54 ++++- 6 files changed, 158 insertions(+), 159 deletions(-) delete mode 100644 packages/yike-design-ui/components/button/src/utils.ts delete mode 100644 packages/yike-design-ui/components/button/style/css.ts diff --git a/packages/yike-design-ui/components/button/src/button.vue b/packages/yike-design-ui/components/button/src/button.vue index f9483e02..24490f87 100644 --- a/packages/yike-design-ui/components/button/src/button.vue +++ b/packages/yike-design-ui/components/button/src/button.vue @@ -1,16 +1,10 @@ diff --git a/packages/yike-design-ui/components/button/src/utils.ts b/packages/yike-design-ui/components/button/src/utils.ts deleted file mode 100644 index 3cab95d0..00000000 --- a/packages/yike-design-ui/components/button/src/utils.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Size } from '../../utils'; - -export const getSize = (size: Size): number => { - switch (size) { - case 's': - return 12; - case 'm': - return 14; - case 'l': - return 14; - case 'xl': - return 16; - default: - return 16; - } -}; diff --git a/packages/yike-design-ui/components/button/style/css.ts b/packages/yike-design-ui/components/button/style/css.ts deleted file mode 100644 index a91762c3..00000000 --- a/packages/yike-design-ui/components/button/style/css.ts +++ /dev/null @@ -1,2 +0,0 @@ -// TODO: 待打包工具完善后 -// 这里需要引入打包后 CSS diff --git a/packages/yike-design-ui/components/button/style/index.less b/packages/yike-design-ui/components/button/style/index.less index 97344000..e09016cc 100644 --- a/packages/yike-design-ui/components/button/style/index.less +++ b/packages/yike-design-ui/components/button/style/index.less @@ -1,135 +1,45 @@ @import '../../styles/mixin.less'; @import './variables.less'; -@import '../../spinner/style/index.less'; -/* stylelint-disable */ -.yk-button--loading { - opacity: 0.7 !important; - .yk-spinner { - margin-right: 4px; - } - - circle { - stroke: #fff !important; - } -} .yk-button { display: inline-flex; justify-content: center; align-items: center; - padding: 6px 16px; + border: 1px solid; white-space: nowrap; - // 默认按钮状态 - color: @btn-primary-color-text; - color: @btn-primary-color-text; - background-color: @btn-primary-color-bg; outline: none; transition: all @animatb; box-sizing: border-box; - border-width: 1px; - border-style: solid; cursor: pointer; user-select: none; - circle { - stroke: @btn-primary-color-text !important; - } + + .btn-type(); + .btn-size(); &__icon { margin-right: @space-ss; } - .btn-type(@type) { - .normal() { - color: ~'@{btn-@{type}-color-text}'; - circle { - stroke: ~'@{btn-@{type}-color-text}' !important; - } - background-color: ~'@{btn-@{type}-color-bg}'; - border-color: ~'@{btn-@{type}-color-border}'; - &:not(:disabled):hover { - background-color: ~'@{btn-@{type}-color-hover}'; - } - &:not(:disabled):active { - background-color: ~'@{btn-@{type}-color-active}'; - } - } - &--@{type} { - .normal(); - } - } + &--loading { + opacity: 0.7 !important; - .btn-status(@type: primary, @status: primary) { - .normal() { - color: ~'@{btn-@{type}-color-text_@{status}}'; - circle { - stroke: ~'@{btn-@{type}-color-text_@{status}}' !important; - } - background-color: ~'@{btn-@{type}-color-bg_@{status}}'; - border-color: ~'@{btn-@{type}-color-border_@{status}}'; - &:not(:disabled):hover { - background-color: ~'@{btn-@{type}-color-hover_@{status}}'; - } - &:not(:disabled):active { - background-color: ~'@{btn-@{type}-color-active_@{status}}'; - } + .yk-spinner { + margin-right: 4px; } - &.yk-button--@{type}.yk-button--@{status} { - .normal(); + + circle { + stroke: #fff !important; } } - .btn-type(primary); - .btn-type(secondary); - .btn-type(outline); - - .btn-status(primary); - .btn-status(primary, success); - .btn-status(primary, warning); - .btn-status(primary, danger); - - .btn-status(secondary); - .btn-status(secondary, success); - .btn-status(secondary, warning); - .btn-status(secondary, danger); - - .btn-status(outline); - .btn-status(outline, success); - .btn-status(outline, warning); - .btn-status(outline, danger); - - // 尺寸 size - &--s { - padding: 0px @space-s; - min-width: 24px; - height: 24px; - font-size: @size-ss; - border-radius: @radius-s; - } - &--m { - padding: 0px @space-l; - min-width: 32px; - height: 32px; - border-radius: @radius-s; - } - &--l { - padding: 0px @space-l; - min-width: 36px; - height: 36px; - border-radius: @radius-m; - } - &--xl { - padding: 0px @space-xl; - min-width: 48px; - height: 48px; - font-size: @size-m; - border-radius: @radius-m; - } + .genTypeAndStatus(); + .gen-size(); + &--long { display: block; width: 100%; } - // 圆角样式 &--round { border-radius: @radius-r; } @@ -137,13 +47,87 @@ padding: 0; border-radius: @radius-r; } - &--square { padding: 0; } - // 禁用 &--disabled { .disabled(); } } + +.genTypeAndStatus() { + @typeList: secondary, outline; + + each(@typeList, { + &--@{value} { + .btn-type(@value); + } + .gen-status(@value); + }); +} + +.gen-status(@type) { + @statusList: primary, success, warning, danger; + + each(@statusList, { + &--@{type}.yk-button--@{value} { + .btn-status(@type, @value); + } + &--@{value} { + .btn-status(primary, @value); + } + }); +} + +.gen-size() { + @sizeList: s, m, xl; + + each(@sizeList, { + &--@{value} { + .btn-size(@value); + } + }); +} + +.btn-type(@type: primary) { + color: ~'@{btn-@{type}-color-text}'; + background-color: ~'@{btn-@{type}-color-bg}'; + border-color: ~'@{btn-@{type}-color-border}'; + + &:not(:disabled):hover { + background-color: ~'@{btn-@{type}-color-hover}'; + } + &:not(:disabled):active { + background-color: ~'@{btn-@{type}-color-active}'; + } + + circle { + stroke: ~'@{btn-@{type}-color-text}' !important; + } +} + +.btn-status(@type, @status: primary) { + color: ~'@{btn-@{type}-color-text_@{status}}'; + background-color: ~'@{btn-@{type}-color-bg_@{status}}'; + border-color: ~'@{btn-@{type}-color-border_@{status}}'; + + &:not(:disabled):hover { + background-color: ~'@{btn-@{type}-color-hover_@{status}}'; + } + &:not(:disabled):active { + background-color: ~'@{btn-@{type}-color-active_@{status}}'; + } + + circle { + stroke: ~'@{btn-@{type}-color-text_@{status}}' !important; + } +} + +.btn-size(@size: l) { + padding: ~'@{btn-size-padding_@{size}}'; + min-width: ~'@{btn-size-minWidth_@{size}}'; + height: ~'@{btn-size-height_@{size}}'; + font-size: ~'@{btn-size-fontSize_@{size}}'; + border-radius: ~'@{btn-size-borderRadius_@{size}}'; +} diff --git a/packages/yike-design-ui/components/button/style/index.ts b/packages/yike-design-ui/components/button/style/index.ts index d74e52ee..8479bad7 100644 --- a/packages/yike-design-ui/components/button/style/index.ts +++ b/packages/yike-design-ui/components/button/style/index.ts @@ -1 +1,2 @@ import './index.less'; +import '../../spinner/style'; diff --git a/packages/yike-design-ui/components/button/style/variables.less b/packages/yike-design-ui/components/button/style/variables.less index 50c370c6..7ffbcec4 100644 --- a/packages/yike-design-ui/components/button/style/variables.less +++ b/packages/yike-design-ui/components/button/style/variables.less @@ -1,51 +1,57 @@ @import '../../styles/color/colors.less'; +// Primary +// btn-[type]-color-text_[status] @btn-primary-color-text: #fff; @btn-primary-color-text_primary: #fff; @btn-primary-color-text_success: #fff; @btn-primary-color-text_warning: #fff; @btn-primary-color-text_danger: #fff; + @btn-primary-color-bg: @pcolor; @btn-primary-color-bg_primary: @pcolor; @btn-primary-color-bg_success: @scolor; @btn-primary-color-bg_warning: @wcolor; @btn-primary-color-bg_danger: @ecolor; + @btn-primary-color-hover: @pcolor-6; -@btn-primary-color-active: @pcolor-8; -@btn-primary-color-border_primary: @pcolor; -@btn-primary-color-border_success: @scolor; -@btn-primary-color-border_warning: @wcolor; -@btn-primary-color-border_danger: @ecolor; @btn-primary-color-hover_primary: @pcolor-6; @btn-primary-color-hover_success: @scolor-6; @btn-primary-color-hover_warning: @wcolor-6; @btn-primary-color-hover_danger: @ecolor-6; + +@btn-primary-color-active: @pcolor-8; @btn-primary-color-active_primary: @pcolor-8; @btn-primary-color-active_success: @scolor-8; @btn-primary-color-active_warning: @wcolor-8; @btn-primary-color-active_danger: @ecolor-8; + @btn-primary-color-border: transparent; @btn-primary-color-border_primary: transparent; @btn-primary-color-border_success: transparent; @btn-primary-color-border_warning: transparent; @btn-primary-color-border_danger: transparent; +// Secondary @btn-secondary-color-text: @font-color-l; @btn-secondary-color-text_primary: @pcolor; @btn-secondary-color-text_success: @scolor; @btn-secondary-color-text_warning: @wcolor; @btn-secondary-color-text_danger: @ecolor; + @btn-secondary-color-bg: @gray-1; -@btn-secondary-color-hover: @gray-2; -@btn-secondary-color-active: @gray-3; @btn-secondary-color-bg_primary: @pcolor-1; @btn-secondary-color-bg_success: @scolor-1; @btn-secondary-color-bg_warning: @wcolor-1; @btn-secondary-color-bg_danger: @ecolor-1; + +@btn-secondary-color-hover: @gray-2; @btn-secondary-color-hover_primary: @pcolor-2; @btn-secondary-color-hover_success: @scolor-2; @btn-secondary-color-hover_warning: @wcolor-2; @btn-secondary-color-hover_danger: @ecolor-2; + +@btn-secondary-color-active: @gray-3; @btn-secondary-color-active_primary: @pcolor-3; @btn-secondary-color-active_success: @scolor-3; @btn-secondary-color-active_warning: @wcolor-3; @@ -57,28 +63,58 @@ @btn-secondary-color-border_warning: transparent; @btn-secondary-color-border_danger: transparent; +// Outline @btn-outline-color-text: @font-color-l; @btn-outline-color-text_primary: @pcolor; @btn-outline-color-text_success: @scolor; @btn-outline-color-text_warning: @wcolor; @btn-outline-color-text_danger: @ecolor; + @btn-outline-color-bg: transparent; -@btn-outline-color-hover: @gray-1; -@btn-outline-color-active: @gray-2; @btn-outline-color-bg_primary: transparent; @btn-outline-color-bg_success: transparent; @btn-outline-color-bg_warning: transparent; @btn-outline-color-bg_danger: transparent; + @btn-outline-color-border: @gray-3; @btn-outline-color-border_primary: @pcolor-3; @btn-outline-color-border_success: @scolor-3; @btn-outline-color-border_warning: @wcolor-3; @btn-outline-color-border_danger: @ecolor-3; + +@btn-outline-color-hover: @gray-1; @btn-outline-color-hover_primary: @pcolor-1; @btn-outline-color-hover_success: @scolor-1; @btn-outline-color-hover_warning: @wcolor-1; @btn-outline-color-hover_danger: @ecolor-1; + +@btn-outline-color-active: @gray-2; @btn-outline-color-active_primary: @pcolor-2; @btn-outline-color-active_success: @scolor-2; @btn-outline-color-active_warning: @wcolor-2; @btn-outline-color-active_danger: @ecolor-2; + +// Size +@btn-size-padding_s: 0px @space-s; +@btn-size-minWidth_s: 24px; +@btn-size-height_s: 24px; +@btn-size-fontSize_s: @size-ss; +@btn-size-borderRadius_s: @radius-s; + +@btn-size-padding_m: 0px @space-l; +@btn-size-minWidth_m: 32px; +@btn-size-height_m: 32px; +@btn-size-fontSize_m: inherit; +@btn-size-borderRadius_m: @radius-s; + +@btn-size-padding_l: 0px @space-l; +@btn-size-minWidth_l: 36px; +@btn-size-height_l: 36px; +@btn-size-fontSize_l: inherit; +@btn-size-borderRadius_l: @radius-m; + +@btn-size-padding_xl: 0px @space-xl; +@btn-size-minWidth_xl: 48px; +@btn-size-height_xl: 48px; +@btn-size-fontSize_xl: @size-m; +@btn-size-borderRadius_xl: @radius-m; From 743931f0a451104853b482f00e9aeca3f9ec03a0 Mon Sep 17 00:00:00 2001 From: rickon_DAFEI <51977404+Rickon-DAFEI@users.noreply.github.com> Date: Fri, 22 Mar 2024 23:03:33 +0800 Subject: [PATCH 02/18] fix(space): fix space undifined (#337) --- packages/yike-design-demo/src/components/Snippet.vue | 7 ++----- .../yike-design-ui/components/radio/src/radio-group.vue | 2 +- packages/yike-design-ui/components/space/src/space.vue | 6 ++++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/yike-design-demo/src/components/Snippet.vue b/packages/yike-design-demo/src/components/Snippet.vue index 45214859..cd8f4a37 100644 --- a/packages/yike-design-demo/src/components/Snippet.vue +++ b/packages/yike-design-demo/src/components/Snippet.vue @@ -56,7 +56,7 @@ function onCopy() {
- +
(), { size: 'l', + align: 'start', + justify: 'start', dir: 'horizontal', overflow: 'visible', wrap: false, @@ -60,8 +62,8 @@ const classList = computed(() => { classes.push(`overflow-${overflow.value}`) } - classes.push(`align-${align?.value}`) - classes.push(`justify-${justify?.value}`) + classes.push(`align-${align.value}`) + classes.push(`justify-${justify.value}`) return classes }) From f70340e78aae096b273aef74866166caa31c154b Mon Sep 17 00:00:00 2001 From: 2113ic Date: Fri, 22 Mar 2024 23:08:31 +0800 Subject: [PATCH 03/18] fix(button): fix status style repeat --- .../components/button/style/index.less | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/packages/yike-design-ui/components/button/style/index.less b/packages/yike-design-ui/components/button/style/index.less index e09016cc..bcf59c1e 100644 --- a/packages/yike-design-ui/components/button/style/index.less +++ b/packages/yike-design-ui/components/button/style/index.less @@ -1,6 +1,10 @@ @import '../../styles/mixin.less'; @import './variables.less'; +@typeList: secondary, outline; +@statusList: primary, success, warning, danger; +@sizeList: s, m, xl; + .yk-button { display: inline-flex; justify-content: center; @@ -12,7 +16,6 @@ box-sizing: border-box; cursor: pointer; user-select: none; - .btn-type(); .btn-size(); @@ -32,6 +35,13 @@ } } + // yk-button--[status] + each(@statusList, { + &--@{value} { + .btn-status(primary, @value); + } + }); + .genTypeAndStatus(); .gen-size(); @@ -57,8 +67,6 @@ } .genTypeAndStatus() { - @typeList: secondary, outline; - each(@typeList, { &--@{value} { .btn-type(@value); @@ -74,15 +82,10 @@ &--@{type}.yk-button--@{value} { .btn-status(@type, @value); } - &--@{value} { - .btn-status(primary, @value); - } }); } .gen-size() { - @sizeList: s, m, xl; - each(@sizeList, { &--@{value} { .btn-size(@value); From 43e237e00b917fafdeeb4c3f34fd05f7b2d4c96b Mon Sep 17 00:00:00 2001 From: rickon_DAFEI <1016831404@qq.com> Date: Fri, 22 Mar 2024 23:33:17 +0800 Subject: [PATCH 04/18] feat(test): remove doc default button style --- packages/demo-test/src/style.css | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/packages/demo-test/src/style.css b/packages/demo-test/src/style.css index cec67f5d..d2e9756a 100644 --- a/packages/demo-test/src/style.css +++ b/packages/demo-test/src/style.css @@ -35,25 +35,6 @@ h1 { line-height: 1.1; } -button { - padding: 0.6em 1.2em; - font-size: 1em; - font-family: inherit; - font-weight: 500; - border: 1px solid transparent; - border-radius: 8px; - background-color: #1a1a1a; - transition: border-color 0.25s; - cursor: pointer; -} -button:hover { - border-color: #646cff; -} -button:focus, -button:focus-visible { - outline: 4px auto -webkit-focus-ring-color; -} - .card { padding: 2em; } From e1a8480519ba90bafd09046786c08a2e44982d01 Mon Sep 17 00:00:00 2001 From: yike <1334785356@qq.com> Date: Sat, 23 Mar 2024 00:01:16 +0800 Subject: [PATCH 05/18] =?UTF-8?q?fix:=20table=E7=BB=84=E4=BB=B6=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../yike-design-demo/src/style/markdown.less | 8 +++--- .../components/table/style/index.less | 27 ++++++++++++------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/packages/yike-design-demo/src/style/markdown.less b/packages/yike-design-demo/src/style/markdown.less index c6dd9c91..213eb827 100644 --- a/packages/yike-design-demo/src/style/markdown.less +++ b/packages/yike-design-demo/src/style/markdown.less @@ -112,17 +112,17 @@ } th { - padding-left: @space-m; + padding: 0 @space-xl; font-size: @size-s; font-weight: 600; text-align: left; - background-color: @bg-color-m; + background-color: @bg-color-s; transition: background-color @animats; - line-height: 44px; + line-height: 56px; } td { - padding: 10px @space-m; + padding: @space-l @space-xl; max-width: 240px; border-top: 1px solid @line-color-s; text-align: left; diff --git a/packages/yike-design-ui/components/table/style/index.less b/packages/yike-design-ui/components/table/style/index.less index 9dd46784..554731dc 100644 --- a/packages/yike-design-ui/components/table/style/index.less +++ b/packages/yike-design-ui/components/table/style/index.less @@ -9,25 +9,35 @@ height: fit-content; box-sizing: border-box; border-spacing: 0; + .td { + padding: @space-m @space-xl; + } } th { + padding: 0 @space-xl; background-color: @bg-color-s; + .cell { + font-weight: 600; + } } - &__cell { position: relative; z-index: 1; - padding: 18px 0px; + padding: @space-s 0; min-width: 0; - font-size: 14px; + max-width: 240px; + height: 56px; + border-bottom: 1px solid @line-color-s; text-align: left; text-overflow: ellipsis; box-sizing: border-box; vertical-align: middle; + .font-s(); .cell { + display: flex; + align-items: center; overflow: hidden; - padding: 0 20px; text-overflow: ellipsis; white-space: normal; box-sizing: border-box; @@ -36,14 +46,13 @@ } } - &__cell { - border-bottom: 1px solid #1e202514; - } - &__row { background-color: @bg-color-l; &:hover { - background-color: @bg-color-s; + background-color: @bg-color-m; + } + .yk-table__cell { + padding: 0 @space-xl; } } From 0648ff4ef4ebb215084eb8dda15f2f0906e31889 Mon Sep 17 00:00:00 2001 From: yike <1334785356@qq.com> Date: Sat, 23 Mar 2024 10:28:46 +0800 Subject: [PATCH 06/18] =?UTF-8?q?fix:=20table=E7=BB=84=E4=BB=B6=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/yike-design-ui/components/table/style/index.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/yike-design-ui/components/table/style/index.less b/packages/yike-design-ui/components/table/style/index.less index 554731dc..7abe98af 100644 --- a/packages/yike-design-ui/components/table/style/index.less +++ b/packages/yike-design-ui/components/table/style/index.less @@ -1,10 +1,11 @@ @import '../../styles/color/colors.less'; .yk-table { + overflow-x: auto; > table { position: relative; overflow: hidden; - width: 100%; + // width: 100%; max-width: 100%; height: fit-content; box-sizing: border-box; @@ -24,7 +25,6 @@ &__cell { position: relative; z-index: 1; - padding: @space-s 0; min-width: 0; max-width: 240px; height: 56px; From b55c32dc7e4ce3323774e1a4c44330993a73ea07 Mon Sep 17 00:00:00 2001 From: yike <1334785356@qq.com> Date: Sat, 23 Mar 2024 10:50:07 +0800 Subject: [PATCH 07/18] =?UTF-8?q?docs:=20Modal=E7=BB=84=E4=BB=B6=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/yike-design-demo/src/examples/modal/modal-base.vue | 2 +- packages/yike-design-demo/src/examples/modal/modal-close.vue | 2 +- .../yike-design-demo/src/examples/modal/modal-footer-show.vue | 2 +- packages/yike-design-demo/src/examples/modal/modal-footer.vue | 2 +- packages/yike-design-demo/src/examples/modal/modal-header.vue | 2 +- packages/yike-design-demo/src/examples/modal/modal-small.vue | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/yike-design-demo/src/examples/modal/modal-base.vue b/packages/yike-design-demo/src/examples/modal/modal-base.vue index c4b20bbb..b8377784 100644 --- a/packages/yike-design-demo/src/examples/modal/modal-base.vue +++ b/packages/yike-design-demo/src/examples/modal/modal-base.vue @@ -11,4 +11,4 @@ const showModal = () => { visible.value = true } - + diff --git a/packages/yike-design-demo/src/examples/modal/modal-close.vue b/packages/yike-design-demo/src/examples/modal/modal-close.vue index 89507d74..fb349174 100644 --- a/packages/yike-design-demo/src/examples/modal/modal-close.vue +++ b/packages/yike-design-demo/src/examples/modal/modal-close.vue @@ -15,4 +15,4 @@ const closeModal = () => { proxy.$message({ type: 'success', message: '这里是对话框关闭的回调函数' }) } - + diff --git a/packages/yike-design-demo/src/examples/modal/modal-footer-show.vue b/packages/yike-design-demo/src/examples/modal/modal-footer-show.vue index b9965ca9..2cc9c591 100644 --- a/packages/yike-design-demo/src/examples/modal/modal-footer-show.vue +++ b/packages/yike-design-demo/src/examples/modal/modal-footer-show.vue @@ -11,4 +11,4 @@ const showModal = () => { visible.value = true } - + diff --git a/packages/yike-design-demo/src/examples/modal/modal-footer.vue b/packages/yike-design-demo/src/examples/modal/modal-footer.vue index 20cb708e..b83aec7b 100644 --- a/packages/yike-design-demo/src/examples/modal/modal-footer.vue +++ b/packages/yike-design-demo/src/examples/modal/modal-footer.vue @@ -12,4 +12,4 @@ const showModal = () => { visible.value = true } - + diff --git a/packages/yike-design-demo/src/examples/modal/modal-header.vue b/packages/yike-design-demo/src/examples/modal/modal-header.vue index 1b08b31d..246a2582 100644 --- a/packages/yike-design-demo/src/examples/modal/modal-header.vue +++ b/packages/yike-design-demo/src/examples/modal/modal-header.vue @@ -12,4 +12,4 @@ const showModal = () => { visible.value = true } - + diff --git a/packages/yike-design-demo/src/examples/modal/modal-small.vue b/packages/yike-design-demo/src/examples/modal/modal-small.vue index dc0078ce..4291f2b6 100644 --- a/packages/yike-design-demo/src/examples/modal/modal-small.vue +++ b/packages/yike-design-demo/src/examples/modal/modal-small.vue @@ -11,4 +11,4 @@ const showModal = () => { visible.value = true } - + From ba18e91e120192c164482c80ed2733f6504157ff Mon Sep 17 00:00:00 2001 From: yike <1334785356@qq.com> Date: Sat, 23 Mar 2024 12:12:04 +0800 Subject: [PATCH 08/18] =?UTF-8?q?fix:=20modal=E7=BB=84=E4=BB=B6=E6=96=B0?= =?UTF-8?q?=E5=A2=9Econtent-hight=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/examples/modal/doc.md | 21 ++++++++++--------- .../components/modal/src/modal.ts | 1 + .../components/modal/src/modal.vue | 9 +++++--- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/packages/yike-design-demo/src/examples/modal/doc.md b/packages/yike-design-demo/src/examples/modal/doc.md index 368059cd..5e9b6851 100644 --- a/packages/yike-design-demo/src/examples/modal/doc.md +++ b/packages/yike-design-demo/src/examples/modal/doc.md @@ -38,16 +38,17 @@ ### API -| 参数 | 描述 | 类型 | 默认值 | -| ------------- | ----------------------------- | ---------------- | ------- | -| `size` | 尺寸 | `small \| large` | `large` | -| `show-footer` | 底部区域展示 | `boolean` | `true` | -| `title` | modal 标题 | `string` | `''` | -| `to` | modal 默认展开的 dom 选择器 | `string` | `body` | -| `scrollable` | 页面可否滚动 | `boolean` | `false` | -| `closeable` | 点击遮罩层是否关闭 modal | `boolean` | `false` | -| `showMask` | 是否展示遮罩层 | `boolean` | `true` | -| `escapable` | 是否可以点击 esc 键关闭 modal | `boolean` | `true` | +| 参数 | 描述 | 类型 | 默认值 | +| ---------------- | ----------------------------- | --------------------- | ------- | +| `size` | 尺寸 | `small \| large` | `large` | +| `show-footer` | 底部区域展示 | `boolean` | `true` | +| `title` | modal 标题 | `string` | `-` | +| `to` | modal 默认展开的 dom 选择器 | `string` | `body` | +| `scrollable` | 页面可否滚动 | `boolean` | `false` | +| `closeable` | 点击遮罩层是否关闭 modal | `boolean` | `false` | +| `showMask` | 是否展示遮罩层 | `boolean` | `true` | +| `escapable` | 是否可以点击 esc 键关闭 modal | `boolean` | `true` | +| `content-height` | 使内容在固定高度内滚动 | `string \| number` | `-` | ### Methods diff --git a/packages/yike-design-ui/components/modal/src/modal.ts b/packages/yike-design-ui/components/modal/src/modal.ts index 20020142..66eef7c3 100644 --- a/packages/yike-design-ui/components/modal/src/modal.ts +++ b/packages/yike-design-ui/components/modal/src/modal.ts @@ -8,4 +8,5 @@ export type modalBaseProps = { showMask?: boolean; escapable?: boolean; showFooter?: boolean; + contentHeight?: string | number; }; diff --git a/packages/yike-design-ui/components/modal/src/modal.vue b/packages/yike-design-ui/components/modal/src/modal.vue index 025d937f..95bb91a6 100644 --- a/packages/yike-design-ui/components/modal/src/modal.vue +++ b/packages/yike-design-ui/components/modal/src/modal.vue @@ -37,9 +37,11 @@
-
- -
+ +
+ +
+