0.0.23 • Published 4 years ago

@retailwe/ui-notice-bar v0.0.23

Weekly downloads
2
License
-
Repository
-
Last release
4 years ago

NoticeBar 通告栏

引入

全局引入,在 miniprogram 根目录下的app.json中配置,局部引入,在需要引入的页面或组件的index.json中配置。

// app.json 或 index.json
"usingComponents": {
  "wr-notice-bar": "@retailwe/ui-notice-bar/index"
}

代码演示

基础用法

<wr-notice-bar
  left-icon="wr-star-filled"
  text="文字内容多于一行时,可通过`scrollable`参数控制是否开启滚动"
/>

禁用滚动

文字内容多于一行时,可通过scrollable参数控制是否开启滚动

<wr-notice-bar
  scrollable="false"
  text="文字内容多于一行时,可通过`scrollable`参数控制是否开启滚动"
/>

多行展示

禁用滚动时,可以设置wrapable来开启多行展示

<wr-notice-bar
  wrapable
  scrollable="false"
  text="文字内容多于一行时,可通过`scrollable`参数控制是否开启滚动"
/>

使用左右插槽

使用left-icon插槽和right-icon插槽自定义左右固定内容

<wr-notice-bar
  text="文字内容多于一行时,可通过`scrollable`参数控制是否开启滚动。"
>
  <text slot="left-icon">[公告]</text>
  <text slot="right-icon">[结束]</text>
</wr-notice-bar>

通告栏模式

默认模式为空,支持closeablelink

<!-- closeable 模式,在右侧显示关闭按钮 -->
<wr-notice-bar
  mode="closeable"
  text="文字内容多于一行时,可通过`scrollable`参数控制是否开启滚动。"
/>

<!-- link 模式,在右侧显示链接箭头 -->
<wr-notice-bar
  mode="link"
  text="文字内容多于一行时,可通过`scrollable`参数控制是否开启滚动。"
/>

自定义滚动速率

使用speed属性控制滚动速率

<wr-notice-bar
  text="{{ text }}"
  speed="{{speedValue}}"
  left-icon="//img.yzcdn.cn/public_files/2017/8/10/6af5b7168eed548100d9041f07b7c616.png"
/>

API

Props

参数说明类型默认值版本
mode通告栏模式,可选值为 closeable linkstring''-
delay动画延迟时间 (s)number1-
speed滚动速率 (px/s)number50-
scrollable是否在长度溢出时滚动播放booleantrue-
left-icon左侧图标名称或图片链接,可选值见 Icon 组件string--
color文本颜色string#ed6a0c-
backgroundColor滚动条背景string#fffbe8-
open-type微信开放能力stringnavigate-

Events

事件名说明参数
bind:click点击事件回调-

Slot

名称说明
left-icon自定义左侧固定内容
right-icon自定义右侧固定内容

外部样式类

类名说明
custom-class根节点样式类
0.0.23

4 years ago

0.0.22

4 years ago

0.0.21

4 years ago

0.0.19

4 years ago

0.0.18

4 years ago

0.0.17

4 years ago

0.0.16

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7-beta.1

4 years ago