Skip to content
On this page

基本使用

html
<uv-notice-bar text="无论我们能活多久,我们能够享受的只有无法分割的此刻,此外别无其他。" />

是否滚动

通过 scrollable 设置

html
<uv-notice-bar text="无论我们能活多久,我们能够享受的只有无法分割的此刻,此外别无其他。" :scrollable="false"/>

插槽

自定义左侧图标插槽名 icon ,自定义内容,默认插槽

html
<uv-notice-bar :scrollable="false">
  test
</uv-notice-bar>

通知栏模式

通过 mode 设置,可选值为 closelink

html
<uv-notice-bar
  class="bottom"
  mode="close"
  speed="90"
  :show-left-icon="false"
  text="无论我们能活多久,我们能够享受的只有无法分割的此刻,此外别无其他。"
  @close="close"
/>
<uv-notice-bar
  mode="link"
  text="米袋虽空——樱花开哉!"
  @click="test"
/>

props

属性含义类型默认值
speed速度[String, Number]60
delay延迟时间[String, Number]1
scrollable是否开启滚动Booleanfalse
text显示的文字String-
color文字颜色String'#ed6a0c'
bgColor背景颜色String'#fffbe8'
showLeftIcon是否显示左边的播放图标Booleantrue
iconProps图标配置Object-
mode通知栏模式,可选close和linkString-
rightIconProps右边icon的配置Object-

events

事件名称含义参数
click点击时-
close关闭时-
replay滚动结束时-

css变量

css
--uv-notice-bar-padding: 0 16px;
  --uv-notice-bar-height: 40px;
  --uv-notice-bar-line-height: 24px;
  --uv-notice-bar-icon-padding: 10px;
  --uv-notice-bar-content-text-font-size: 14px;

Released under the MIT License.