步进器 Stepper

基本用法

步进器 Stepper - 图1

  1. <template lang="html">
  2. <main>
  3. <div class="demo-hidden">
  4. <za-panel>
  5. <za-panel-header title="基本"></za-panel-header>
  6. <za-panel-body>
  7. <za-cell title="普通">
  8. <za-stepper slot='description' v-model='stepper1' @change='handleChange'></za-stepper>
  9. </za-cell>
  10. <za-cell title="设置默认值">
  11. <za-stepper slot='description' v-model='stepper2' @change='handleChange'></za-stepper>
  12. </za-cell>
  13. <za-cell title="设置上下限">
  14. <za-stepper slot='description' v-model='stepper3' @change='handleChange' :min='-3' :max='3'></za-stepper>
  15. </za-cell>
  16. <za-cell title="设置步长">
  17. <za-stepper slot='description' v-model='stepper4' @change='handleChange' :step='0.5'></za-stepper>
  18. </za-cell>
  19. <za-cell title="禁用状态">
  20. <za-stepper slot='description' v-model='stepper5' @change='handleChange' disabled></za-stepper>
  21. </za-cell>
  22. </za-panel-body>
  23. </za-panel>
  24. <za-panel>
  25. <za-panel-header title="多形状"></za-panel-header>
  26. <za-panel-body>
  27. <za-cell title="圆角">
  28. <za-stepper slot='description' v-model='stepper6' @change='handleChange' shape="radius"></za-stepper>
  29. </za-cell>
  30. <za-cell title="圆型">
  31. <za-stepper slot='description' v-model='stepper7' @change='handleChange' shape="circle"></za-stepper>
  32. </za-cell>
  33. </za-panel-body>
  34. </za-panel>
  35. </div>
  36. </main>
  37. </template>
  38. <script>
  39. export default {
  40. data() {
  41. return {
  42. stepper1: 0,
  43. stepper2: 2,
  44. stepper3: 0,
  45. stepper4: 0,
  46. stepper5: 0,
  47. stepper6: 0,
  48. stepper7: 0,
  49. }
  50. },
  51. methods: {
  52. handleChange(event) {
  53. console.log(event);
  54. }
  55. },
  56. };
  57. </script>

API

Stepper Attributes

属性类型默认值可选值/参数说明
prefixClsstringza-stepper类名前缀
themestring'primary''default', 'primary', 'info', 'success', 'warning', 'error'主题
shapestring'radius', 'circle'形状
v-modelnumber绑定值
disabledboolfalse是否禁用
minnumber最小值
maxnumber最大值
stepnumber1步长

Stepper Events

事件名称说明回调参数
change点击加减后触发的事件event 事件对象