tree: 0851968e5396d63a3e7a888ef95c09a7698db21a [path history] [tgz]
  1. index.js
  2. index.vue
  3. package.json
  4. README.md
  5. README_cn.md
packages/wxc-stepper/README.md

wxc-stepper

Enter a number within certain range with the mouse or keyboard.

Rule

  • When a numeric value needs to be provided.

Demo

    

Code Example

<template>
  <div class="wrapper">
    <div class="demo">
      <text class="text">no config:</text>
      <wxc-stepper></wxc-stepper>
    </div>
    <div class="demo">
      <text class="text">{min:2,max:10,step:2,defaultValue:4}</text>
      <wxc-stepper default-value="4"
                   step="2"
                   max="10"
                   min="2"
                   @wxcStepperValueChanged="stepperValueChange"></wxc-stepper>
    </div>
    <div class="demo">
      <text class="text">disabled</text>
      <wxc-stepper default-value="4"
                   step="2"
                   max="10"
                   min="2"
                   :disabled="isDisabled"></wxc-stepper>
    </div>

    <div class="demo">
      <text class="text">input只读:</text>
      <wxc-stepper :read-only="isOnlyRead"></wxc-stepper>
    </div>
  </div>
</template>

<script>
  import { WxcStepper } from 'weex-ui';
  export default {
    components: { WxcStepper },
    data: () => ({
      value: 4,
      isDisabled: true,
      isOnlyRead: true
    }),
    methods: {
      stepperValueChange (e) {
        console.log(e.value);
      }
    }
  };
</script>

More details can be found in here

API

PropTypeRequiredDefaultDescription
default-valueNumberN1initial value
stepNumberN1step value
minNumberN1min value
maxNumberN100max value
disabledBooleanNfalsedisable the stepper
read-onlyBooleanNfalsedisable the input

Event

@wxcStepperValueChanged="wxcStepperValueChanged"
@wxcStepperValueIsMinOver="wxcStepperValueIsMinOver"
@wxcStepperValueIsMaxOver="wxcStepperValueIsMaxOver"