<template>
  <el-form-item :label="label" :rules="requireRule(required, label)" :prop="prop" :label-width="labelWidth">
    <el-input-number
      v-model="$parent.model[prop]"
      :placeholder="placeholder || `请输入${label}`" :clearable="clearable" :disabled="disabled"
      :min="min" :max="max" :precision="precision" :controls="false" />
      <span class="suffix">{{suffix}}</span>
  </el-form-item>
</template>

<script>
import mixin from './mixin'
/**
 * 数字输入框组件
 */
export default {
  mixins: [mixin],
  props: {
    min: {
      type: Number,
      default: 0
    },
    max: {
      type: Number,
      default: 99999999
    },
    precision: {
      type: Number,
      default: 0
    },
    labelWidth: {
      type: String
    },
  }
}
</script>

<style>
.el-input-number{
  width: 100%;
}
.suffix{
    font-size: 14px;
    color: #FF6600;
    line-height: 20px;
    padding-left: 20px;
}
</style>
