按钮 Button

基本用法

按钮 Button - 图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-button theme="primary">普通按钮</za-button>
  9. <za-button theme="primary" block>块级按钮</za-button>
  10. <za-button theme="primary" block active>激活状态的按钮</za-button>
  11. <za-button theme="primary" block disabled>禁用状态的按钮</za-button>
  12. </za-panel-body>
  13. </za-panel>
  14. <za-panel>
  15. <za-panel-header title="幽灵按钮">
  16. </za-panel-header>
  17. <za-panel-body>
  18. <za-button block bordered>幽灵按钮</za-button>
  19. <za-button block bordered active>激活状态的按钮</za-button>
  20. <za-button block bordered disabled>禁用状态的按钮</za-button>
  21. <za-button theme="primary" block bordered>幽灵按钮</za-button>
  22. <za-button theme="primary" block bordered active>激活状态的按钮</za-button>
  23. <za-button theme="primary" block bordered disabled>禁用状态的按钮</za-button>
  24. </za-panel-body>
  25. </za-panel>
  26. <za-panel>
  27. <za-panel-header title="多主题">
  28. </za-panel-header>
  29. <za-panel-body>
  30. <za-button>Default</za-button>
  31. <za-button theme="primary">primary</za-button>
  32. <za-button theme="info">info</za-button>
  33. <za-button theme="success">success</za-button>
  34. <za-button theme="warning">warning</za-button>
  35. <za-button theme="error">error</za-button>
  36. </za-panel-body>
  37. </za-panel>
  38. <za-panel>
  39. <za-panel-header title="按钮大小">
  40. </za-panel-header>
  41. <za-panel-body>
  42. <za-button theme="primary" size='xl'>xl</za-button>
  43. <za-button theme="primary" size='lg'>lg</za-button>
  44. <za-button theme="primary">md</za-button>
  45. <za-button theme="primary" size='sm'>sm</za-button>
  46. <za-button theme="primary" size='xs'>xs</za-button>
  47. </za-panel-body>
  48. </za-panel>
  49. <za-panel>
  50. <za-panel-header title="多形状">
  51. </za-panel-header>
  52. <za-panel-body>
  53. <za-button bordered shape="radius">圆角按钮</za-button>
  54. <za-button bordered shape="round">椭圆角按钮</za-button>
  55. <za-button bordered shape="circle">GO</za-button>
  56. <za-button bordered shape="circle">
  57. <za-icon type='right' slot='icon'></za-icon>
  58. </za-button>
  59. </za-panel-body>
  60. </za-panel>
  61. <za-panel>
  62. <za-panel-header title="带icon的按钮">
  63. </za-panel-header>
  64. <za-panel-body>
  65. <za-button bordered shape="radius">
  66. <za-icon type='right-round' theme='success' slot='icon'></za-icon>
  67. 正确
  68. </za-button>
  69. <za-button bordered shape="radius">
  70. <za-icon type='wrong-round' theme='error' slot='icon'></za-icon>
  71. 错误
  72. </za-button>
  73. <za-button bordered loading shape="radius">
  74. 加载中
  75. </za-button>
  76. </za-panel-body>
  77. </za-panel>
  78. </div>
  79. </div>
  80. </template>

API

Button Attributes

属性类型默认值可选值/参数说明
prefixClsstringza-button类名前缀
themestring'default''default', 'primary', 'info', 'success', 'warning', 'error'主题
sizestring'xl', 'lg', 'sm', 'xs'大小
shapestring'radius', 'round', 'circle'形状
blockboolfalse是否为块级元素
borderedboolfalse是否是幽灵按钮
disabledboolfalse是否禁用
loadingboolfalse是否显示加载中

Button Events

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