UiInput.vue 2.0 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 : '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. @change="selectChange">
  22. </el-input>
  23. </el-col>
  24. <el-col :span="7">
  25. <div class="classJs">
  26. <div v-if="tips">
  27. <span class="red">*</span>&ensp;{{tips}}
  28. </div>
  29. </div>
  30. </el-col>
  31. </el-row>
  32. </template>
  33. <script>
  34. export default {
  35. props: ['label','value','placeholder','disabled','name','minlength','maxlength','readonly','autofocus','autoComplete','size','tips', 'type', 'showPassword'],
  36. data() {
  37. return {
  38. text: this.value ? this.value : '',
  39. typeV: this.type ? this.type : 'text'
  40. };
  41. },
  42. mounted() {},
  43. methods: {
  44. selectChange(value) {
  45. this.$emit('set-keys',value);
  46. },
  47. }
  48. }
  49. </script>
  50. <style scoped>
  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>