UiInputNumber.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. :disabled="disabled ? disabled : false"
  14. :controls="controls ? false : controls">
  15. </el-input-number>
  16. <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"/>
  17. </el-col>
  18. <el-col :span="7">
  19. <div class="classJs">
  20. <div v-if="tips">
  21. <span class="red">*</span>&ensp;{{tips}}
  22. </div>
  23. </div>
  24. </el-col>
  25. </el-row>
  26. </template>
  27. <script>
  28. export default {
  29. props: ['label','name','value','min','max','step','disabled','controls','tips'],
  30. data() {
  31. return {
  32. valueD: this.value ? this.value : 1
  33. };
  34. },
  35. mounted() {
  36. //console.log(this);
  37. },
  38. methods: {
  39. handleChange(value) {
  40. //console.log(this);
  41. //console.log(value);
  42. }
  43. }
  44. }
  45. </script>
  46. <style scoped>
  47. .el-input__inner {
  48. display: none;
  49. }
  50. .classJs {
  51. margin-left: 10px;
  52. vertical-align: middle;
  53. height:42px;
  54. line-height:42px;
  55. }
  56. .red{
  57. color: red;
  58. }
  59. </style>