UiInputText.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 : 'Text'}}</label>
  5. </el-col>
  6. <el-col :span="14">
  7. <el-input
  8. type="text"
  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. :autofocus="autofocus ? true : false"
  18. :id="name"
  19. :size="size ? size : 'large'"
  20. @change="selectChange">
  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'],
  35. data() {
  36. return {
  37. text: this.value ? this.value : ''
  38. };
  39. },
  40. mounted() {
  41. },
  42. methods: {
  43. selectChange(value) {
  44. this.$emit('set-keys',value);
  45. },
  46. }
  47. }
  48. </script>
  49. <style scoped>
  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>