UiInputText.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. </el-input>
  21. </el-col>
  22. <el-col :span="7">
  23. <div class="classJs">
  24. <div v-if="tips">
  25. <span class="red">*</span>&ensp;{{tips}}
  26. </div>
  27. </div>
  28. </el-col>
  29. </el-row>
  30. </template>
  31. <script>
  32. export default {
  33. props: ['label','value','placeholder','disabled','name','minlength','maxlength','readonly','autofocus','autoComplete','size','tips'],
  34. data() {
  35. return {
  36. text: this.value ? this.value : ''
  37. };
  38. },
  39. mounted() {
  40. },
  41. methods: {
  42. }
  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>