UiInputFloatNumber.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <el-row class="form-group">
  3. <el-col :span="3" style="min-height:50px;padding-top:10px;">
  4. <label style="margin-left:10px;vertical-align: middle;" class="control-label">{{label ? label : 'Number'}}</label>
  5. </el-col>
  6. <el-col :span="14">
  7. <el-input-number
  8. v-model="valueD"
  9. @change="handleChange"
  10. :min="min ? parseInt(min) : 1"
  11. :max="max ? parseInt(max) : 100"
  12. :step="step ? step : 1"
  13. :precision="precision ? parseInt(precision) : 1"
  14. :disabled="disabled ? disabled : false"
  15. :controls="controls ? false : controls">
  16. </el-input-number>
  17. <input type="text" :id="name" style="width:0;height:0.5px;border: 0 solid rgba(255,255,255,0)" :name="name ? name : 'number'" :value="valueD"/>
  18. </el-col>
  19. <el-col :span="7">
  20. <div class="classJs">
  21. <div v-if="tips">
  22. <span class="red">*</span>&ensp;{{tips}}
  23. </div>
  24. </div>
  25. </el-col>
  26. </el-row>
  27. </template>
  28. <script>
  29. export default {
  30. props: ['label','name','value','min','max','step','disabled','controls','tips','precision'],
  31. data() {
  32. return {
  33. valueD: this.value ? this.value : 1
  34. };
  35. },
  36. mounted() {
  37. //console.log(this);
  38. },
  39. methods: {
  40. handleChange(value) {
  41. //console.log(this);
  42. //console.log(value);
  43. }
  44. }
  45. }
  46. </script>
  47. <style scoped>
  48. .el-input__inner {
  49. display: none;
  50. }
  51. .classJs {
  52. margin-left: 10px;
  53. vertical-align: middle;
  54. height:42px;
  55. line-height:42px;
  56. }
  57. .red{
  58. color: red;
  59. }
  60. </style>