UiInput.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 : 'Text'}}</label>
  5. </el-col>
  6. <el-col :span="14">
  7. <el-input
  8. :type="typeV"
  9. v-model="text"
  10. :placeholder="placeholder ? placeholder : ''"
  11. :disabled="disabled ? true : false"
  12. :name="name ? name : 'text'"
  13. :minlength="minlength ? parseInt(minlength) : 0"
  14. :maxlength="maxlength ? parseInt(maxlength) : 200"
  15. :auto-complete="autoComplete ? 'on' : 'off'"
  16. :readonly="readonly ? true : false"
  17. :show-password="showPassword ? true : false"
  18. :autofocus="autofocus ? true : false"
  19. :id="name"
  20. :size="size ? size : 'large'">
  21. </el-input>
  22. </el-col>
  23. <el-col :span="7">
  24. <div class="classJs">
  25. <div v-if="tips">
  26. <span class="red">*</span>&ensp;{{tips}}
  27. </div>
  28. </div>
  29. </el-col>
  30. </el-row>
  31. </template>
  32. <script>
  33. export default {
  34. props: ['label','value','placeholder','disabled','name','minlength','maxlength','readonly','autofocus','autoComplete','size','tips', 'type', 'showPassword'],
  35. data() {
  36. return {
  37. text: this.value ? this.value : '',
  38. typeV: this.type ? this.type : 'text'
  39. };
  40. },
  41. mounted() {},
  42. methods: {}
  43. }
  44. </script>
  45. <style scoped>
  46. .classJs {
  47. margin-left: 10px;
  48. vertical-align: middle;
  49. height:42px;
  50. line-height:42px;
  51. }
  52. .red{
  53. color: red;
  54. }
  55. </style>