通告栏 NoticeBar

基本用法

  1. <za-notice-bar>普通</za-notice-bar>
  2. <za-notice-bar theme="error">错误色</za-notice-bar>
  3. <za-notice-bar icon="wrong-round">自定义图标</za-notice-bar>
  4. <za-notice-bar scrollable>各位zarmer请注意,本组件使用了自动滚动功能,更多用法请参见使用文档。</za-notice-bar>

特定场景

  1. <za-notice-bar hasArrow @click="handleClick">链接样式的</za-notice-bar>
  2. <!-- 也可以不绑定visible -->
  3. <za-notice-bar closable :visible.sync="visible">
  4. 可关闭的
  5. </za-notice-bar>

Vue Script

  1. <script name="vue">
  2. export default {
  3. data() {
  4. return {
  5. visible: true,
  6. }
  7. },
  8. methods: {
  9. handleClick(){
  10. alert('click this notice!');
  11. }
  12. },
  13. };
  14. </script>

API

NoticeBar Attributes

属性类型默认值可选值/参数说明
themestring'warning''primary', 'success', 'warning', 'error'主题
iconstring设置图标
scrollablebooleanfalse是否开启自动滚动轮播
closablebooleanfalse是否显示关闭按钮
has-arrowbooleanfalse是否显示箭头

NoticeBar Events

事件名称说明回调参数
clickclick 时触发的事件event 事件对象

NoticeBar 通告栏 - 图1