From c8860081a750993f95784acf696420236bf168f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E5=A4=A9=E9=AA=81?= Date: Wed, 18 Sep 2019 14:22:43 +0800 Subject: [PATCH] feat(NoticeBar): add left/right-icon slot (#2029) --- example/pages/notice-bar/index.wxml | 9 ++++++++- packages/notice-bar/README.md | 28 ++++++++++++++++++++++++++++ packages/notice-bar/index.wxml | 4 +++- 3 files changed, 39 insertions(+), 2 deletions(-) diff --git a/example/pages/notice-bar/index.wxml b/example/pages/notice-bar/index.wxml index 61ab75df..17f86774 100644 --- a/example/pages/notice-bar/index.wxml +++ b/example/pages/notice-bar/index.wxml @@ -14,6 +14,13 @@ - + + + + + [公告] + [结束] + + \ No newline at end of file diff --git a/packages/notice-bar/README.md b/packages/notice-bar/README.md index a206e194..93532cb3 100644 --- a/packages/notice-bar/README.md +++ b/packages/notice-bar/README.md @@ -31,6 +31,27 @@ /> ``` +### 多行展示 +禁用滚动时,可以设置`wrapable`来开启多行展示 + +```html + +``` + +### 使用左右插槽 +使用`left-icon`插槽和`right-icon`插槽自定义左右固定内容 + +```html + + [公告] + [结束] + +``` + ### 通告栏模式 默认模式为空,支持`closeable`和`link`。 @@ -69,6 +90,13 @@ |-----------|-----------|-----------| | bind:click | 点击事件回调 | - | +### Slot + +| 名称 | 说明 | +|-----------|-----------| +| left-icon | 自定义左侧固定内容 | +| right-icon | 自定义右侧固定内容 | + ### 外部样式类 | 类名 | 说明 | diff --git a/packages/notice-bar/index.wxml b/packages/notice-bar/index.wxml index 034ce6fe..38b7bc00 100644 --- a/packages/notice-bar/index.wxml +++ b/packages/notice-bar/index.wxml @@ -12,6 +12,7 @@ name="{{ leftIcon }}" class="van-notice-bar__left-icon" /> + @@ -26,10 +27,11 @@ bind:tap="onClickIcon" /> +