Skip to content

Commit 4c16cf8

Browse files
feat(popconfirm): [popconfirm] Adapting to the SMB theme (#2168)
1 parent 3b78e2f commit 4c16cf8

File tree

5 files changed

+27
-23
lines changed

5 files changed

+27
-23
lines changed

examples/sites/demos/pc/app/popconfirm/type-composition-api.vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,44 @@
11
<template>
22
<div>
3-
<tiny-popconfirm :title="title" type="info">
3+
<tiny-popconfirm :title="title" type="info" :message="message">
44
<template #reference>
55
<tiny-button>info</tiny-button>
66
</template>
77
</tiny-popconfirm>
88

9-
<tiny-popconfirm :title="title" type="error">
9+
<tiny-popconfirm :title="title" type="error" :message="message">
1010
<template #reference>
1111
<tiny-button>error</tiny-button>
1212
</template>
1313
</tiny-popconfirm>
1414

15-
<tiny-popconfirm :title="title" type="warning">
15+
<tiny-popconfirm :title="title" type="warning" :message="message">
1616
<template #reference>
1717
<tiny-button>warning</tiny-button>
1818
</template>
1919
</tiny-popconfirm>
2020

21-
<tiny-popconfirm :title="title" type="success">
21+
<tiny-popconfirm :title="title" type="success" :message="message">
2222
<template #reference>
2323
<tiny-button>success</tiny-button>
2424
</template>
2525
</tiny-popconfirm>
2626

27-
<tiny-popconfirm :title="title" :type="TinyIconDel">
27+
<tiny-popconfirm :title="title" :type="TinyIconDel" :message="message">
2828
<template #reference>
2929
<tiny-button>自定义</tiny-button>
3030
</template>
3131
</tiny-popconfirm>
3232
</div>
3333
</template>
34+
3435
<script setup>
3536
import { ref } from 'vue'
3637
import { Popconfirm as TinyPopconfirm, Button as TinyButton } from '@opentiny/vue'
3738
import { iconDel } from '@opentiny/vue-icon'
3839
39-
const title = ref('确定要删除该安全组规则吗?')
40+
const title = ref('提示标题')
41+
const message = ref('安全组规则是推荐的,确定要删除该安全组规则吗?')
4042
const TinyIconDel = iconDel()
4143
</script>
4244

examples/sites/demos/pc/app/popconfirm/type.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
<template>
22
<div>
3-
<tiny-popconfirm :title="title" type="info">
3+
<tiny-popconfirm :title="title" type="info" :message="message">
44
<template #reference>
55
<tiny-button>info</tiny-button>
66
</template>
77
</tiny-popconfirm>
88

9-
<tiny-popconfirm :title="title" type="error">
9+
<tiny-popconfirm :title="title" type="error" :message="message">
1010
<template #reference>
1111
<tiny-button>error</tiny-button>
1212
</template>
1313
</tiny-popconfirm>
1414

15-
<tiny-popconfirm :title="title" type="warning">
15+
<tiny-popconfirm :title="title" type="warning" :message="message">
1616
<template #reference>
1717
<tiny-button>warning</tiny-button>
1818
</template>
1919
</tiny-popconfirm>
2020

21-
<tiny-popconfirm :title="title" type="success">
21+
<tiny-popconfirm :title="title" type="success" :message="message">
2222
<template #reference>
2323
<tiny-button>success</tiny-button>
2424
</template>
2525
</tiny-popconfirm>
2626

27-
<tiny-popconfirm :title="title" :type="TinyIconDel">
27+
<tiny-popconfirm :title="title" :type="TinyIconDel" :message="message">
2828
<template #reference>
2929
<tiny-button>自定义</tiny-button>
3030
</template>
@@ -43,7 +43,8 @@ export default {
4343
},
4444
data() {
4545
return {
46-
title: '确定要删除该安全组规则吗?',
46+
title: '提示标题',
47+
message: '安全组规则是推荐的,确定要删除该安全组规则吗?',
4748
TinyIconDel: iconDel()
4849
}
4950
}

packages/theme/src/popconfirm/index.less

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,8 @@
4141
&__header {
4242
display: flex;
4343
align-items: center;
44-
line-height: var(--ti-popconfirm-popover-line-height);
4544
margin-bottom: var(--ti-popconfirm-popover-margin-bottom);
4645
}
47-
.no-message {
48-
font-weight: 400;
49-
}
5046

5147
&__icon {
5248
height: var(--ti-popconfirm-popover-icon-width);
@@ -56,14 +52,14 @@
5652
}
5753

5854
&__title {
59-
flex: 1 1 auto;
6055
font-size: var(--ti-popconfirm-popover-title-font-size);
6156
font-weight: var(--ti-popconfirm-popover-title-font-weight);
57+
line-height: var(--ti-popconfirm-popover-title-line-height);
6258
}
6359

6460
&__content {
6561
color: var(--ti-popconfirm-popover-text-color);
66-
line-height: var(--ti-popconfirm-popover-line-height);
62+
line-height: var(--ti-popconfirm-popover-content-line-height);
6763
}
6864

6965
&__footer {
@@ -73,6 +69,7 @@
7369
}
7470

7571
&__confirm-button {
72+
margin-left: 8px;
7673
width: 72px;
7774
}
7875

packages/theme/src/popconfirm/vars.less

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,20 @@
1111
*/
1212

1313
.component-css-vars-popconfirm() {
14-
// 提示弹窗字体行高
15-
--ti-popconfirm-popover-line-height: 1.5;
14+
// 提示弹窗title字体行高
15+
--ti-popconfirm-popover-title-line-height:var(--ti-common-line-height-2);
16+
// 提示弹窗content字体行高
17+
--ti-popconfirm-popover-content-line-height: var(--ti-common-line-height-1);
1618
// 底部按钮flex排列方式
1719
--ti-popconfirm-popover-footer-justify-content: right;
1820
// 提示弹窗字体大小
1921
--ti-popconfirm-popover-footer-font-size: var(--ti-common-font-size-base, 12px);
2022
// 提示弹窗字体颜色
2123
--ti-popconfirm-popover-footer-font-color: #191919;
2224
// 提示弹窗容器垂直内边距
23-
--ti-popconfirm-popover-container-padding-vertical: unset;
25+
--ti-popconfirm-popover-container-padding-vertical: var(--ti-common-space-base);
2426
// 提示弹窗图标大小
25-
--ti-popconfirm-popover-icon-width: var(--ti-common-size-4x);
27+
--ti-popconfirm-popover-icon-width: var(--ti-common-size-5x);
2628
--ti-popconfirm-popover-icon-margin-bottom: 2px;
2729
// 提示弹窗图标上侧外边距
2830
--ti-popconfirm-popover-icon-margin-right: var(--ti-common-space-base);
@@ -32,4 +34,6 @@
3234
--ti-popconfirm-popover-title-font-size: var(--ti-common-font-size-2);
3335
--ti-popconfirm-popover-title-font-weight: var(--ti-common-font-weight-bold);
3436
--ti-popconfirm-popover-text-color: #191919;
37+
// 标题距离内容下边距
38+
--ti-popconfirm-popover-margin-bottom: var(--ti-common-space-2x);
3539
}

packages/vue/src/popconfirm/src/pc.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
:class="['tiny-popconfirm-popover__icon', type ? `tiny-popconfirm-popover--${type}` : '']"
2323
>
2424
</component>
25-
<div class="tiny-popconfirm-popover__title" :class="[message ? '' : 'no-message']">
25+
<div class="tiny-popconfirm-popover__title">
2626
{{ title }}
2727
</div>
2828
</div>

0 commit comments

Comments
 (0)