UiInputNumber.vue 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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="selectChange"
  10. :min="min ? parseInt(min) : 0"
  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. selectChange(value) {
  40. this.$emit('set-keys',value);
  41. },
  42. handleChange(value) {
  43. //console.log(this);
  44. //console.log(value);
  45. }
  46. }
  47. }
  48. </script>
  49. <style scoped>
  50. .el-input__inner {
  51. display: none;
  52. }
  53. .classJs {
  54. margin-left: 10px;
  55. vertical-align: middle;
  56. height:42px;
  57. line-height:42px;
  58. }
  59. .red{
  60. color: red;
  61. }
  62. </style>