Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(button): [button] refactor the component variables of the button component. #2193

Merged
merged 19 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions examples/sites/demos/pc/app/button/ghost.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,61 +16,61 @@ test('幽灵按钮', async ({ page }) => {
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(194, 194, 194)')
await expect(getGhostBtn(0)).toHaveCSS('border-bottom-color', 'rgb(25, 25, 25)')

// 次要幽灵按钮
await page.waitForTimeout(1000)
await expect(getGhostBtn(1)).toHaveCSS('color', 'rgb(89, 89, 89)')
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(89, 89, 89)')
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(89, 89, 89)')
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(219, 219, 219)')
await expect(getGhostBtn(1)).toHaveCSS('border-bottom-color', 'rgb(25, 25, 25)')

// 成功幽灵按钮
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(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(218, 242, 187)')
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(20, 118, 255)')
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(222, 236, 255)')
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, 136, 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, 235, 209)')
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(242, 48, 48)')
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(252, 226, 224)')
await expect(getGhostBtn(5)).toHaveCSS('border-bottom-color', 'rgb(242, 48, 48)')
})
10 changes: 5 additions & 5 deletions examples/sites/demos/pc/app/button/size-composition-api.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,44 @@
<div class="title">常规按钮尺寸:</div>
<tiny-button size="large"> 超大按钮 </tiny-button>
<tiny-button size="medium"> 中等按钮 </tiny-button>
<tiny-button size="small"> 小型按钮 </tiny-button>
<tiny-button> 默认按钮 </tiny-button>
<tiny-button size="small"> 小型按钮 </tiny-button>
<tiny-button size="mini"> 超小按钮 </tiny-button>
</tiny-row>

<tiny-row>
<div class="title">朴素按钮尺寸:</div>
<tiny-button type="primary" size="large" plain> 超大按钮 </tiny-button>
<tiny-button type="primary" size="medium" plain> 中等按钮 </tiny-button>
<tiny-button type="primary" size="small" plain> 小型按钮 </tiny-button>
<tiny-button type="primary" plain> 默认按钮 </tiny-button>
<tiny-button type="primary" size="small" plain> 小型按钮 </tiny-button>
<tiny-button type="primary" size="mini" plain> 超小按钮 </tiny-button>
</tiny-row>

<tiny-row>
<div class="title">圆角按钮尺寸:</div>
<tiny-button type="success" size="large" round> 超大按钮 </tiny-button>
<tiny-button type="success" size="medium" round> 中等按钮 </tiny-button>
<tiny-button type="success" size="small" round> 小型按钮 </tiny-button>
<tiny-button type="success" round> 默认按钮 </tiny-button>
<tiny-button type="success" size="small" round> 小型按钮 </tiny-button>
<tiny-button type="success" size="mini" round> 超小按钮 </tiny-button>
</tiny-row>

<tiny-row>
<div class="title">圆形按钮尺寸:</div>
<tiny-button type="warning" size="large" :icon="TinyIconEdit" circle> </tiny-button>
<tiny-button type="warning" size="medium" :icon="TinyIconEdit" circle> </tiny-button>
<tiny-button type="warning" size="small" :icon="TinyIconEdit" circle> </tiny-button>
<tiny-button type="warning" :icon="TinyIconEdit" circle></tiny-button>
<tiny-button type="warning" size="small" :icon="TinyIconEdit" circle> </tiny-button>
<tiny-button type="warning" size="mini" :icon="TinyIconEdit" circle> </tiny-button>
</tiny-row>

<tiny-row>
<div class="title">纯图标按钮尺寸:</div>
<tiny-button :icon="TinyIconDel" type="text" size="large" />
<tiny-button :icon="TinyIconDel" type="text" size="medium" />
<tiny-button :icon="TinyIconDel" type="text" size="small" />
<tiny-button :icon="TinyIconDel" type="text" />
<tiny-button :icon="TinyIconDel" type="text" size="small" />
<tiny-button :icon="TinyIconDel" type="text" size="mini" />
</tiny-row>
</tiny-layout>
Expand Down
10 changes: 5 additions & 5 deletions examples/sites/demos/pc/app/button/size.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,44 +4,44 @@
<div class="title">常规按钮尺寸:</div>
<tiny-button size="large"> 超大按钮 </tiny-button>
<tiny-button size="medium"> 中等按钮 </tiny-button>
<tiny-button size="small"> 小型按钮 </tiny-button>
<tiny-button> 默认按钮 </tiny-button>
<tiny-button size="small"> 小型按钮 </tiny-button>
<tiny-button size="mini"> 超小按钮 </tiny-button>
</tiny-row>

<tiny-row>
<div class="title">朴素按钮尺寸:</div>
<tiny-button type="primary" size="large" plain> 超大按钮 </tiny-button>
<tiny-button type="primary" size="medium" plain> 中等按钮 </tiny-button>
<tiny-button type="primary" size="small" plain> 小型按钮 </tiny-button>
<tiny-button type="primary" plain> 默认按钮 </tiny-button>
<tiny-button type="primary" size="small" plain> 小型按钮 </tiny-button>
<tiny-button type="primary" size="mini" plain> 超小按钮 </tiny-button>
</tiny-row>

<tiny-row>
<div class="title">圆角按钮尺寸:</div>
<tiny-button type="success" size="large" round> 超大按钮 </tiny-button>
<tiny-button type="success" size="medium" round> 中等按钮 </tiny-button>
<tiny-button type="success" size="small" round> 小型按钮 </tiny-button>
<tiny-button type="success" round> 默认按钮 </tiny-button>
<tiny-button type="success" size="small" round> 小型按钮 </tiny-button>
<tiny-button type="success" size="mini" round> 超小按钮 </tiny-button>
</tiny-row>

<tiny-row>
<div class="title">圆形按钮尺寸:</div>
<tiny-button type="warning" size="large" :icon="TinyIconEdit" circle> </tiny-button>
<tiny-button type="warning" size="medium" :icon="TinyIconEdit" circle> </tiny-button>
<tiny-button type="warning" size="small" :icon="TinyIconEdit" circle> </tiny-button>
<tiny-button type="warning" :icon="TinyIconEdit" circle></tiny-button>
<tiny-button type="warning" size="small" :icon="TinyIconEdit" circle> </tiny-button>
<tiny-button type="warning" size="mini" :icon="TinyIconEdit" circle> </tiny-button>
</tiny-row>

<tiny-row>
<div class="title">纯图标按钮尺寸:</div>
<tiny-button :icon="TinyIconDel" type="text" size="large" />
<tiny-button :icon="TinyIconDel" type="text" size="medium" />
<tiny-button :icon="TinyIconDel" type="text" size="small" />
<tiny-button :icon="TinyIconDel" type="text" />
<tiny-button :icon="TinyIconDel" type="text" size="small" />
<tiny-button :icon="TinyIconDel" type="text" size="mini" />
</tiny-row>
</tiny-layout>
Expand Down
Loading
Loading