Skip to content

Commit

Permalink
feat(badge): [badge]: Adapting to the SMB theme
Browse files Browse the repository at this point in the history
  • Loading branch information
Youyou-smiles committed Sep 23, 2024
1 parent 2f4db09 commit cc92077
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions examples/sites/demos/pc/app/badge/max.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<template>
<div>
<tiny-badge :value="10" :max="9">最大值显示</tiny-badge>
<br />
<tiny-badge value="100" :max="99" data="我的待办"></tiny-badge>
<br />
<tiny-badge value="1000" :max="999" data="我的待办"></tiny-badge>
</template>
</div>
</template>

<script>
Expand Down
5 changes: 3 additions & 2 deletions examples/sites/demos/pc/app/badge/type-composition-api.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
<template>
<div class="badge-demo">
<tiny-badge :value="2">默认类型</tiny-badge>
<tiny-badge :value="2" type="danger">danger 类型</tiny-badge>
<tiny-badge :value="2" type="primary">primary 类型</tiny-badge>
<tiny-badge :value="2" type="success">success 类型</tiny-badge>
<tiny-badge :value="2" type="warning">warning 类型</tiny-badge>
<tiny-badge :value="2" type="info">info 类型</tiny-badge>
<tiny-badge :value="2" type="danger">danger 类型</tiny-badge>
<tiny-badge :value="2" type="primary">primary 类型</tiny-badge>
</div>
</template>

<script setup>
import { Badge as TinyBadge } from '@opentiny/vue'
</script>

<style scoped>
.badge-demo .tiny-badge__wrapper {
margin-bottom: 12px;
Expand Down
10 changes: 5 additions & 5 deletions examples/sites/demos/pc/app/badge/type.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ test('主題样式', async ({ page }) => {

const demo = page.locator('#type')
const badge = demo.locator('.tiny-badge')
const dangerBadge = badge.nth(1)
const primaryBadge = badge.nth(2)
const successBadge = badge.nth(3)
const warningBadge = badge.nth(4)
const infoBadge = badge.nth(5)
const successBadge = badge.nth(1)
const warningBadge = badge.nth(2)
const infoBadge = badge.nth(3)
const dangerBadge = badge.nth(4)
const primaryBadge = badge.nth(5)

await expect(dangerBadge).toHaveClass(/tiny-badge--danger/)
await expect(dangerBadge).toHaveCSS('background-color', 'rgb(246, 111, 106)')
Expand Down
5 changes: 3 additions & 2 deletions examples/sites/demos/pc/app/badge/type.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<template>
<div class="badge-demo">
<tiny-badge :value="2">默认类型</tiny-badge>
<tiny-badge :value="2" type="danger">danger 类型</tiny-badge>
<tiny-badge :value="2" type="primary">primary 类型</tiny-badge>
<tiny-badge :value="2" type="success">success 类型</tiny-badge>
<tiny-badge :value="2" type="warning">warning 类型</tiny-badge>
<tiny-badge :value="2" type="info">info 类型</tiny-badge>
<tiny-badge :value="2" type="danger">danger 类型</tiny-badge>
<tiny-badge :value="2" type="primary">primary 类型</tiny-badge>
</div>
</template>

Expand All @@ -18,6 +18,7 @@ export default {
}
}
</script>

<style scoped>
.badge-demo .tiny-badge__wrapper {
margin-bottom: 12px;
Expand Down

0 comments on commit cc92077

Please sign in to comment.