<template>
  <view class="form-number-wrap">
    <input type="digit" :value="value" :placeholder="placeholder" placeholder-class="placeholder" class="form-input" @input="onInput" />
  </view>
</template>

<script>
export default {
  name: 'FormItemNumber',
  props: {
    value: { type: [String, Number], default: '' },
    placeholder: { type: String, default: '请输入' }
  },
  methods: {
    onInput: function(e) {
      this.$emit('input', e.target.value);
    }
  }
};
</script>

<style scoped>
.form-number-wrap {
  flex: 1;
  display: flex;
  align-items: center;
}
.form-input {
  flex: 1;
  font-size: 28rpx;
  color: #333333;
  text-align: center;
}
.placeholder {
  font-weight: 400;
  font-size: 28rpx;
  color: #999999;
}
</style>
