Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Latest commit

History

History
84 lines (69 loc) 路 2.33 KB

File metadata and controls

84 lines (69 loc) 路 2.33 KB

wxc-stepper

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

Rule

  • When a numeric value needs to be provided.

聽聽聽聽

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

Prop Type Required Default Description
default-value Number N 1 initial value
step Number N 1 step value
min Number N 1 min value
max Number N 100 max value
disabled Boolean N false disable the stepper
read-only Boolean N false disable the input

Event

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