消息 Message

基本用法

消息 Message - 图1

  1. <template lang="html">
  2. <div>
  3. <div class="demo-hidden">
  4. <za-panel>
  5. <za-panel-header title="基本"></za-panel-header>
  6. <za-panel-body>
  7. <za-message>primary</za-message>
  8. <za-message theme='info'>
  9. <za-icon type='info-round' class='icon' slot='icon'></za-icon>
  10. <span>info</span>
  11. </za-message>
  12. <za-message theme='success' icon='right-round'>
  13. <span>success</span>
  14. </za-message>
  15. <za-message theme='warning'>
  16. <za-icon type='info-round' class='icon' slot='icon'></za-icon>
  17. <span>warning</span>
  18. </za-message>
  19. <za-message theme='error'>
  20. <za-icon type='wrong-round' class='icon' slot='icon'></za-icon>
  21. <span>error</span>
  22. </za-message>
  23. </za-panel-body>
  24. </za-panel>
  25. <za-panel>
  26. <za-panel-header title="可操作"></za-panel-header>
  27. <za-panel-body>
  28. <za-message theme='warning' hasArrow @click='handleClick'>链接样式的</za-message>
  29. <!-- 也可以不绑定visible -->
  30. <za-message theme='error' closable :visible.sync='visible'>链接样式的</za-message>
  31. </za-panel-body>
  32. </za-panel>
  33. </div>
  34. </div>
  35. </template>
  36. <script>
  37. export default {
  38. data() {
  39. return {
  40. visible: true
  41. }
  42. },
  43. methods: {
  44. handleClick(event) {
  45. console.log(event);
  46. alert('click this message!');
  47. }
  48. },
  49. };
  50. </script>

API

Message Attributes

属性类型默认值可选值/参数说明
prefixClsstringza-message类名前缀
themestring'primary''default', 'primary', 'info', 'success', 'warning', 'error'主题
hasClosableboolfalse是否显示关闭按钮
hasArrowboolfalse是否显示箭头

Message Events

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