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

feat(button-group): [button-group] Adapting to the SMB theme #2088

Merged
merged 6 commits into from
Sep 9, 2024
Merged
35 changes: 11 additions & 24 deletions examples/sites/demos/pc/app/button-group/sup-composition-api.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
</template>
</tiny-button-group>
</div>
<br /><br />
<p>插槽引用tag角标</p>
<div class="tag">
<tiny-button-group :data="groupDataTag" v-model="checkedVal">
<template #btn="{ sup }">
<tiny-tag type="warning" size="small" hit>
<component :is="sup.icon" class="tiny-svg-size"></component>
<tiny-tag type="danger" class="tiny-only-icon" size="small">
<component :is="sup.icon"></component>
{{ sup.text }}
</tiny-tag>
</template>
Expand Down Expand Up @@ -96,16 +95,6 @@ const groupDataTag = ref([
class: 'sup-tag',
icon: iconPlusCircle()
}
},
{
text: '组合',
value: 'Button4',
sup: {
slot: 'btn',
class: 'sup-tag',
icon: iconPlusCircle(),
text: '8折'
}
}
])
</script>
Expand All @@ -132,25 +121,23 @@ const groupDataTag = ref([
</style>

<style>

.demo-button p {
margin: 16px 0 8px 0;
}
.demo-button .sup button {
width: 84px;
width: 96px;
}
.demo-button .sup li:nth-of-type(4) button {
width: 124px;
}
.demo-button .tag button {
width: 84px;
}
.demo-button .tag li:last-child button {
width: 120px;
.demo-button .tag li:first-child button {
width: 100px;
}
.demo-button p {
margin-bottom: 8px;
}
.demo-button .tiny-tag {
border-radius: 0px 5px 0 8px;
}
.demo-button .tiny-svg-size {
margin-right: 4px;
.tiny-only-icon {
border-radius: 0px 6px;
}
</style>
30 changes: 8 additions & 22 deletions examples/sites/demos/pc/app/button-group/sup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,12 @@
</template>
</tiny-button-group>
</div>
<br /><br />
<p>插槽引用tag角标</p>
<div class="tag">
<tiny-button-group :data="groupData2" v-model="checkedVal">
<template #btn="{ sup }">
<tiny-tag type="warning" size="small" hit>
<component :is="sup.icon" class="tiny-svg-size"></component>
<tiny-tag type="danger" class="tiny-only-icon" size="small">
<component :is="sup.icon"></component>
{{ sup.text }}
</tiny-tag>
</template>
Expand Down Expand Up @@ -103,16 +102,6 @@ export default {
class: 'sup-tag',
icon: iconPlusCircle()
}
},
{
text: '组合',
value: 'Button4',
sup: {
slot: 'btn',
class: 'sup-tag',
icon: iconPlusCircle(),
text: '8折'
}
}
]
}
Expand Down Expand Up @@ -143,24 +132,21 @@ export default {

<style>
.demo-button p {
margin-bottom: 8px;
margin: 16px 0 8px 0;
}
.demo-button .sup button {
width: 84px;
width: 96px;
}
.demo-button .sup li:nth-of-type(4) button {
width: 124px;
}
.demo-button .tag button {
width: 84px;
}
.demo-button .tag li:last-child button {
width: 120px;
}
.demo-button .tiny-tag {
border-radius: 0px 5px 0 8px;
.demo-button .tag li:first-child button {
width: 100px;
}
.demo-button .tiny-svg-size {
margin-right: 4px;
.tiny-only-icon {
border-radius: 0px 6px;
}
</style>
Loading