feat: improve word wrap (#2061)

This commit is contained in:
neverland 2019-09-19 16:15:06 +08:00 committed by GitHub
parent 6206d7bda5
commit 673eee42b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 14 additions and 10 deletions

View File

@ -43,7 +43,7 @@
&__title, &__title,
&__desc { &__desc {
word-break: break-all; word-wrap: break-word;
} }
&__title { &__title {

View File

@ -49,7 +49,7 @@
} }
&__label { &__label {
word-break: break-all; word-wrap: break-word;
.theme(margin-left, '@checkbox-label-margin'); .theme(margin-left, '@checkbox-label-margin');
.theme(color, '@checkbox-label-color'); .theme(color, '@checkbox-label-color');

View File

@ -133,7 +133,7 @@ Page({
| 参数 | 说明 | 类型 | 默认值 | 版本 | | 参数 | 说明 | 类型 | 默认值 | 版本 |
|-----------|-----------|-----------|-------------|-------------| |-----------|-----------|-----------|-------------|-------------|
| title | 标题 | *string* | - | - | | title | 标题 | *string* | - | - |
| message | 内容 | *string* | - | - | | message | 文本内容,支持通过`\n`换行 | *string* | - | 1.0.0 |
| messageAlign | 内容对齐方式,可选值为`left` `right` | *string* | `center` | - | | messageAlign | 内容对齐方式,可选值为`left` `right` | *string* | `center` | - |
| zIndex | z-index 层级 | *number* | `100` | - | | zIndex | z-index 层级 | *number* | `100` | - |
| className | 自定义类名dialog在自定义组件内时无效 | *string* | '' | - | | className | 自定义类名dialog在自定义组件内时无效 | *string* | '' | - |

View File

@ -29,6 +29,10 @@
text-align: center; text-align: center;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
&-text {
word-wrap: break-word;
}
&--has-title { &--has-title {
padding-top: 12px; padding-top: 12px;
.theme(color, '@gray-darker'); .theme(color, '@gray-darker');

View File

@ -21,7 +21,7 @@
wx:elif="{{ message }}" wx:elif="{{ message }}"
class="van-dialog__message {{ title ? 'van-dialog__message--has-title' : '' }} {{ messageAlign ? 'van-dialog__message--' + messageAlign : '' }}" class="van-dialog__message {{ title ? 'van-dialog__message--has-title' : '' }} {{ messageAlign ? 'van-dialog__message--' + messageAlign : '' }}"
> >
<text>{{ message }}</text> <text class="van-dialog__message-text">{{ message }}</text>
</view> </view>
<view class="van-hairline--top van-dialog__footer"> <view class="van-hairline--top van-dialog__footer">

View File

@ -51,7 +51,7 @@
} }
&__text { &__text {
word-break: break-all; word-wrap: break-word;
.theme(color, '@grid-item-text-color'); .theme(color, '@grid-item-text-color');
.theme(font-size, '@grid-item-text-font-size'); .theme(font-size, '@grid-item-text-font-size');
} }

View File

@ -7,7 +7,7 @@
box-sizing: border-box; box-sizing: border-box;
width: 100%; width: 100%;
text-align: center; text-align: center;
word-break: break-all; word-wrap: break-word;
.theme(padding, '@notify-padding'); .theme(padding, '@notify-padding');
.theme(font-size, '@notify-font-size'); .theme(font-size, '@notify-font-size');
.theme(line-height, '@notify-line-height'); .theme(line-height, '@notify-line-height');

View File

@ -52,7 +52,7 @@ Page({
<van-popup <van-popup
show="{{ show }}" show="{{ show }}"
position="top" position="top"
style="height: 20%" style="height: 20%;"
bind:close="onClose" bind:close="onClose"
/> />
``` ```

View File

@ -43,7 +43,7 @@
} }
&__label { &__label {
word-break: break-all; word-wrap: break-word;
.theme(margin-left, '@radio-label-margin'); .theme(margin-left, '@radio-label-margin');
.theme(color, '@radio-label-color'); .theme(color, '@radio-label-color');

View File

@ -8,7 +8,7 @@
overflow: hidden; overflow: hidden;
font-size: 14px; font-size: 14px;
line-height: 1.4; line-height: 1.4;
word-break: break-all; word-wrap: break-word;
border-left: 3px solid transparent; border-left: 3px solid transparent;
user-select: none; user-select: none;
.theme(color, '@gray-darker'); .theme(color, '@gray-darker');

View File

@ -13,7 +13,7 @@
// allow newline charactor // allow newline charactor
white-space: pre-wrap; white-space: pre-wrap;
word-break: break-all; word-wrap: break-word;
.theme(background-color, '@toast-background-color'); .theme(background-color, '@toast-background-color');
.theme(border-radius, '@toast-border-radius'); .theme(border-radius, '@toast-border-radius');