From 774d5d78975d03d14c53e989da80fe122f1aeccc Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 18 Sep 2019 16:11:58 +0800 Subject: [PATCH] feat(Notify): support line-break charactor (#2045) --- packages/notify/README.md | 10 +++++----- packages/notify/index.less | 1 - packages/notify/index.wxml | 7 +++---- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/packages/notify/README.md b/packages/notify/README.md index 7d00cbee..63799fe9 100644 --- a/packages/notify/README.md +++ b/packages/notify/README.md @@ -76,16 +76,16 @@ Notify({ ## API -### Props +### Options | 参数 | 说明 | 类型 | 默认值 | 版本 | |-----------|-----------|-----------|-------------|-------------| -| type | 类型,可选值为 `primary` `info` `warning` | *string* | `danger` | - | -| message | 展示文案 | *string* | - | - | -| duration | 持续时间 | *number* | `3000` | - | +| type | 类型,可选值为 `primary` `info` `warning` | *string* | `danger` | 1.0.0 | +| message | 展示文案,支持通过`\n`换行 | *string* | 1.0.0 | - | +| duration | 展示时长(ms),值为 0 时,notify 不会消失 | *number* | `3000` | - | | selector | 自定义节点选择器 | *string* | `van-notify` | - | | color | 字体颜色 | *string* | `#fff` | - | -| background | 背景色 | *string* | - | - | +| background | 背景颜色 | *string* | - | - | | context | 选择器的选择范围,可以传入自定义组件的 this 作为上下文 | *object* | 当前页面 | - | | safe-area-inset-top | 是否留出顶部安全距离(状态栏高度) | *boolean* | `false` | - | | onClick | 点击时的回调函数 | *Function* | - | - | diff --git a/packages/notify/index.less b/packages/notify/index.less index 37f56885..2f358f26 100644 --- a/packages/notify/index.less +++ b/packages/notify/index.less @@ -9,7 +9,6 @@ font-size: @notify-font-size; line-height: @notify-line-height; text-align: center; - word-break: break-all; &--primary { background-color: @notify-primary-background-color; diff --git a/packages/notify/index.wxml b/packages/notify/index.wxml index 5cd0d15b..d3f7366c 100644 --- a/packages/notify/index.wxml +++ b/packages/notify/index.wxml @@ -3,9 +3,8 @@ show="{{ show }}" custom-class="van-notify van-notify--{{ type }}" custom-style="background:{{ background }}; color: {{ color }}; z-index: {{ zIndex }};" + bind:tap="onTap" > - - - {{ message }} - + + {{ message }}