Skip to content

Commit 09dde62

Browse files
fix: 🐛 修复 Toast 英文断行样式错误问题 (#1067)
1 parent 875e072 commit 09dde62

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/locale/en-US.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@
702702
"ju-jue": "refuse",
703703
"ju-ming-cha-cao-zhe-shi-yi-tiao-jian-dan-de-shi-li-wen-zi-zhe-shi-yi-tiao-jian-dan-de-shi-li-wen-zi-zhe-shi-yi-tiao-jian-dan-de-shi-li-wen-zi-zhe-shi-yi-tiao-jian-dan-de-shi-li-wen-zi-zhe-shi-yi-tiao-jian-dan-de-shi-li-wen-zi-zhe-shi-yi-tiao-jian-dan-de-shi-li-wen-zi-zhe-shi-yi-tiao-jian-dan-de-shi-li-wen-zi-zhe-shi-yi-tiao-jian-dan-de-shi-li-wen-zi": "Named slot: This is a simple example text. This is a simple example text. This is a simple example text. This is a simple example text. This is a simple example text. This is a simple example text. This is a simple example text. This is a simple example text.",
704704
"ju-xing-ka-pian": "Rectangular card",
705-
"ju-zhong-toast": "Mid game toast",
705+
"ju-zhong-toast": "Center toast",
706706
"juanZeng": "donate",
707707
"ka-pi-ba-la": "Card! Pi! Ba! PULL!",
708708
"ka-pian-yang-shi": "Card style",

src/locale/zh-CN.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@
702702
"ju-jue": "拒绝",
703703
"ju-ming-cha-cao-zhe-shi-yi-tiao-jian-dan-de-shi-li-wen-zi-zhe-shi-yi-tiao-jian-dan-de-shi-li-wen-zi-zhe-shi-yi-tiao-jian-dan-de-shi-li-wen-zi-zhe-shi-yi-tiao-jian-dan-de-shi-li-wen-zi-zhe-shi-yi-tiao-jian-dan-de-shi-li-wen-zi-zhe-shi-yi-tiao-jian-dan-de-shi-li-wen-zi-zhe-shi-yi-tiao-jian-dan-de-shi-li-wen-zi-zhe-shi-yi-tiao-jian-dan-de-shi-li-wen-zi": "具名插槽:这是一条简单的示例文字。这是一条简单的示例文字。这是一条简单的示例文字。这是一条简单的示例文字。这是一条简单的示例文字。这是一条简单的示例文字。这是一条简单的示例文字。这是一条简单的示例文字。",
704704
"ju-xing-ka-pian": "矩形卡片",
705-
"ju-zhong-toast": "局中toast",
705+
"ju-zhong-toast": "居中toast",
706706
"juanZeng": "捐赠",
707707
"ka-pi-ba-la": "卡!皮!巴!拉!",
708708
"ka-pian-yang-shi": "卡片样式",

src/uni_modules/wot-design-uni/components/common/abstracts/variable.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,16 +639,19 @@ $-tag-close-color: var(--wot-tag-close-color, $-tag-info-color) !default; // 关
639639
$-tag-close-active-color: var(--wot-tag-close-active-color, rgba(0, 0, 0, 0.45)) !default; // 关闭按钮 active 颜色
640640

641641
/* toast */
642+
$-toast-color: var(--wot-toast-color, $-color-white) !default; // 文字颜色
642643
$-toast-padding: var(--wot-toast-padding, 16px 24px) !default; // padding
643644
$-toast-max-width: var(--wot-toast-max-width, 300px) !default; // 最大宽度
644645
$-toast-radius: var(--wot-toast-radius, 8px) !default; // 圆角大小
645646
$-toast-bg: var(--wot-toast-bg, $-overlay-bg) !default; // 背景色
646647
$-toast-fs: var(--wot-toast-fs, $-fs-content) !default; // 字号
648+
$-toast-line-height: var(--wot-toast-line-height, 20px) !default; // 行高
647649
$-toast-with-icon-min-width: var(--wot-toast-with-icon-min-width, 150px) !default; // 有图标的情况下最小宽度
648650
$-toast-icon-size: var(--wot-toast-icon-size, 32px) !default; // 图标大小
649651
$-toast-icon-margin-right: var(--wot-toast-icon-margin-right, 12px) !default; // 图标右边距
650652
$-toast-icon-margin-bottom: var(--wot-toast-icon-margin-bottom, 12px) !default; // 图标下边距
651-
$-toast-loading-padding: var(--wot-toast-loading-padding, 10px) !default; // loading 下的padding
653+
$-toast-loading-padding: var(--wot-toast-loading-padding, 10px) !default; // loading状态下的padding
654+
$-toast-loading-margin-bottom: var(--wot-toast-loading-margin-bottom, 16px) !default; // loading动画的margin-bottom
652655
$-toast-box-shadow: var(--wot-toast-box-shadow, 0px 6px 16px 0px rgba(0, 0, 0, 0.08)) !default; // 外部阴影
653656

654657
/* loading */

src/uni_modules/wot-design-uni/components/wd-toast/index.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
padding: $-toast-padding;
88
background-color: $-toast-bg;
99
border-radius: $-toast-radius;
10-
color: #fff;
10+
color: $-toast-color;
1111
transition: all 0.2s;
1212
font-size: $-toast-fs;
1313
box-sizing: border-box;
@@ -19,7 +19,8 @@
1919

2020
@include e(msg) {
2121
font-size: $-toast-fs;
22-
line-height: 20px;
22+
word-break: break-all;
23+
line-height: $-toast-line-height;
2324
text-align: left;
2425
font-family: "San Francisco", Rotobo, arial, "PingFang SC", "Noto SansCJK", "Microsoft Yahei", sans-serif;
2526
}
@@ -50,7 +51,7 @@
5051
background-repeat: no-repeat;
5152
}
5253
@include e(loading) {
53-
margin-bottom: 16px;
54+
margin-bottom: $-toast-loading-margin-bottom;
5455
display: inline-block;
5556
}
5657
@include m(top) {

0 commit comments

Comments
 (0)