From 595dd8ba4569bec03522914ac8e2d7840b16790e Mon Sep 17 00:00:00 2001 From: shenjunjian <40288193@qq.com> Date: Sat, 19 Oct 2024 01:09:31 -0700 Subject: [PATCH 1/4] fix(button): fix error css var --- .../demos/pc/app/button/ghost-composition-api.vue | 12 ++++++------ examples/sites/demos/pc/app/button/ghost.vue | 12 ++++++------ packages/theme/src/button/vars.less | 4 ++-- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/sites/demos/pc/app/button/ghost-composition-api.vue b/examples/sites/demos/pc/app/button/ghost-composition-api.vue index d3bfae3f7a..e6c708940f 100644 --- a/examples/sites/demos/pc/app/button/ghost-composition-api.vue +++ b/examples/sites/demos/pc/app/button/ghost-composition-api.vue @@ -1,11 +1,11 @@ diff --git a/examples/sites/demos/pc/app/button/ghost.vue b/examples/sites/demos/pc/app/button/ghost.vue index dbf529801d..ad303e10fd 100644 --- a/examples/sites/demos/pc/app/button/ghost.vue +++ b/examples/sites/demos/pc/app/button/ghost.vue @@ -1,11 +1,11 @@ diff --git a/packages/theme/src/button/vars.less b/packages/theme/src/button/vars.less index dfa888fa1f..e3d77d6263 100644 --- a/packages/theme/src/button/vars.less +++ b/packages/theme/src/button/vars.less @@ -16,8 +16,8 @@ --tv-Button-font-weight: var(--tv-font-weight-regular); // 默认时按钮边框宽度 --tv-Button-border-width: var(--tv-border-width); - // 按钮的行产, - --tv-Button-line-height: var(--tv-border-width); + // 按钮的文本行高 + --tv-Button-line-height: var(--tv-line-height-number); // --------------------------------------------------- 场景1、圆角-------------------------------------------- // 默认时按钮圆角 --tv-Button-border-radius: var(--tv-border-radius-round); // 默认规范不需要 6px的圆角的效果,默认就是半圆 From 49358cc2bf177542f60cdf34b3b2d57f5b048a2a Mon Sep 17 00:00:00 2001 From: shenjunjian <40288193@qq.com> Date: Sat, 19 Oct 2024 01:14:48 -0700 Subject: [PATCH 2/4] fix(button): fix --- .../sites/demos/pc/app/button/basic-usage-composition-api.vue | 2 +- examples/sites/demos/pc/app/button/basic-usage.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/sites/demos/pc/app/button/basic-usage-composition-api.vue b/examples/sites/demos/pc/app/button/basic-usage-composition-api.vue index 3baf8be69f..e705127be3 100644 --- a/examples/sites/demos/pc/app/button/basic-usage-composition-api.vue +++ b/examples/sites/demos/pc/app/button/basic-usage-composition-api.vue @@ -2,7 +2,7 @@

基本按钮

- 主要按钮 + 主要按钮 次要按钮 成功按钮 信息按钮 diff --git a/examples/sites/demos/pc/app/button/basic-usage.vue b/examples/sites/demos/pc/app/button/basic-usage.vue index 81bce35b16..081059fd34 100644 --- a/examples/sites/demos/pc/app/button/basic-usage.vue +++ b/examples/sites/demos/pc/app/button/basic-usage.vue @@ -2,7 +2,7 @@

基本按钮

- 主要按钮 + 主要按钮 次要按钮 成功按钮 信息按钮 From 89e8edf0ee0318b62e096214e12db345a8188819 Mon Sep 17 00:00:00 2001 From: shenjunjian <40288193@qq.com> Date: Sat, 19 Oct 2024 02:18:16 -0700 Subject: [PATCH 3/4] fix(button): fix button e2e test --- .../sites/demos/pc/app/button/ghost.spec.ts | 40 +------------------ packages/theme/src/button/vars.less | 2 +- 2 files changed, 3 insertions(+), 39 deletions(-) diff --git a/examples/sites/demos/pc/app/button/ghost.spec.ts b/examples/sites/demos/pc/app/button/ghost.spec.ts index b337116abc..251652343b 100644 --- a/examples/sites/demos/pc/app/button/ghost.spec.ts +++ b/examples/sites/demos/pc/app/button/ghost.spec.ts @@ -11,66 +11,30 @@ test('幽灵按钮', async ({ page }) => { await expect(getGhostBtn(0)).toHaveCSS('color', 'rgb(25, 25, 25)') await expect(getGhostBtn(0)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') await expect(getGhostBtn(0)).toHaveCSS('border-bottom-color', 'rgb(89, 89, 89)') - await page.waitForTimeout(100) - await getGhostBtn(0).click() - await page.waitForTimeout(100) - await expect(getGhostBtn(0)).toHaveCSS('color', 'rgb(25, 25, 25)') - await expect(getGhostBtn(0)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') - await expect(getGhostBtn(0)).toHaveCSS('border-bottom-color', 'rgb(25, 25, 25)') // 次要幽灵按钮 await page.waitForTimeout(1000) - await expect(getGhostBtn(1)).toHaveCSS('color', 'rgb(25, 25, 25)') - await expect(getGhostBtn(1)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') - await expect(getGhostBtn(1)).toHaveCSS('border-bottom-color', 'rgb(194, 194, 194)') - await page.waitForTimeout(100) - await getGhostBtn(1).click() - await page.waitForTimeout(100) - await expect(getGhostBtn(1)).toHaveCSS('color', 'rgb(25, 25, 25)') + await expect(getGhostBtn(1)).toHaveCSS('color', 'rgb(89, 89, 89)') await expect(getGhostBtn(1)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') - await expect(getGhostBtn(1)).toHaveCSS('border-bottom-color', 'rgb(25, 25, 25)') + await expect(getGhostBtn(1)).toHaveCSS('border-bottom-color', 'rgb(128, 128, 128)') // 成功幽灵按钮 await expect(getGhostBtn(2)).toHaveCSS('color', 'rgb(92, 179, 0)') await expect(getGhostBtn(2)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') - await expect(getGhostBtn(2)).toHaveCSS('border-bottom-color', 'rgb(218, 242, 187)') - await page.waitForTimeout(100) - await getGhostBtn(2).click() - await page.waitForTimeout(100) - await expect(getGhostBtn(2)).toHaveCSS('color', 'rgb(92, 179, 0)') - await expect(getGhostBtn(2)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') await expect(getGhostBtn(2)).toHaveCSS('border-bottom-color', 'rgb(92, 179, 0)') // 信息幽灵按钮 await expect(getGhostBtn(3)).toHaveCSS('color', 'rgb(20, 118, 255)') await expect(getGhostBtn(3)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') - await expect(getGhostBtn(3)).toHaveCSS('border-bottom-color', 'rgb(222, 236, 255)') - await page.waitForTimeout(100) - await getGhostBtn(3).click() - await page.waitForTimeout(100) - await expect(getGhostBtn(3)).toHaveCSS('color', 'rgb(20, 118, 255)') - await expect(getGhostBtn(3)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') await expect(getGhostBtn(3)).toHaveCSS('border-bottom-color', 'rgb(20, 118, 255)') // 告警幽灵按钮 await expect(getGhostBtn(4)).toHaveCSS('color', 'rgb(255, 136, 0)') await expect(getGhostBtn(4)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') - await expect(getGhostBtn(4)).toHaveCSS('border-bottom-color', 'rgb(255, 235, 209)') - await page.waitForTimeout(100) - await getGhostBtn(4).click() - await page.waitForTimeout(100) - await expect(getGhostBtn(4)).toHaveCSS('color', 'rgb(255, 136, 0)') - await expect(getGhostBtn(4)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') await expect(getGhostBtn(4)).toHaveCSS('border-bottom-color', 'rgb(255, 136, 0)') // 危险幽灵按钮 await expect(getGhostBtn(5)).toHaveCSS('color', 'rgb(242, 48, 48)') await expect(getGhostBtn(5)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') - await expect(getGhostBtn(5)).toHaveCSS('border-bottom-color', 'rgb(252, 226, 224)') - await page.waitForTimeout(100) - await getGhostBtn(5).click() - await page.waitForTimeout(100) - await expect(getGhostBtn(5)).toHaveCSS('color', 'rgb(242, 48, 48)') - await expect(getGhostBtn(5)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') await expect(getGhostBtn(5)).toHaveCSS('border-bottom-color', 'rgb(242, 48, 48)') }) diff --git a/packages/theme/src/button/vars.less b/packages/theme/src/button/vars.less index e3d77d6263..edea9fe5d5 100644 --- a/packages/theme/src/button/vars.less +++ b/packages/theme/src/button/vars.less @@ -181,7 +181,7 @@ --tv-Button-border-color-ghost-default: var(--tv-color-border-ghost); // primary 主题时按钮幽灵文本色 - --tv-Button-text-colorghostn-primary: var(--tv-color-act-primary-text); + --tv-Button-text-color-ghost-primary: var(--tv-color-act-primary-text); // primary 主题时按钮幽灵边框色 --tv-Button-border-color-ghost-primary: var(--tv-color-act-primary-border-light); From c3186065148880ddb21e242c8f71f483e58b746c Mon Sep 17 00:00:00 2001 From: shenjunjian <40288193@qq.com> Date: Sat, 19 Oct 2024 02:19:03 -0700 Subject: [PATCH 4/4] fix(button): fix --- examples/sites/demos/pc/app/button/ghost.spec.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/sites/demos/pc/app/button/ghost.spec.ts b/examples/sites/demos/pc/app/button/ghost.spec.ts index 251652343b..3961615447 100644 --- a/examples/sites/demos/pc/app/button/ghost.spec.ts +++ b/examples/sites/demos/pc/app/button/ghost.spec.ts @@ -13,7 +13,6 @@ test('幽灵按钮', async ({ page }) => { await expect(getGhostBtn(0)).toHaveCSS('border-bottom-color', 'rgb(89, 89, 89)') // 次要幽灵按钮 - await page.waitForTimeout(1000) await expect(getGhostBtn(1)).toHaveCSS('color', 'rgb(89, 89, 89)') await expect(getGhostBtn(1)).toHaveCSS('background-color', 'rgba(0, 0, 0, 0)') await expect(getGhostBtn(1)).toHaveCSS('border-bottom-color', 'rgb(128, 128, 128)')