徽标 Badge

基本用法

徽标 Badge - 图1

  1. <template lang="html">
  2. <div>
  3. <div class="demo-hidden">
  4. <za-panel>
  5. <za-panel-header title="基本">
  6. </za-panel-header>
  7. <za-panel-body>
  8. <za-cell has-arrow title="点状">
  9. <za-badge slot='description' shape='dot' @click='handleClick'></za-badge>
  10. </za-cell>
  11. <za-cell has-arrow title="直角">
  12. <za-badge slot='description' text='免费'></za-badge>
  13. </za-cell>
  14. <za-cell has-arrow title="圆角">
  15. <za-badge slot='description' text='new' shape='radius'></za-badge>
  16. </za-cell>
  17. <za-cell has-arrow title="椭圆">
  18. <span slot='description'>
  19. <za-badge :text.number='3' shape='circle'></za-badge>
  20. <za-badge text='999+' shape='round'></za-badge>
  21. </span>
  22. </za-cell>
  23. </za-panel-body>
  24. </za-panel>
  25. </div>
  26. </div>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. }
  33. },
  34. methods: {
  35. handleClick(e) {
  36. console.log(e);
  37. },
  38. },
  39. };
  40. </script>

API

Badge Attributes

属性类型默认值可选值/参数说明
prefixClsstringza-badge类名前缀
themestring'error''default', 'primary', 'info', 'success', 'warning', 'error'主题
shapestring'dot', 'radius', 'round', 'circle'形状
textstring, number显示文字
supboolfalse是否上标位置

Badge Events

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