UiTextarea.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <el-row class="form-group">
  3. <el-col style="padding-top:10px;" :span="3">
  4. <label style="margin-left:10px;vertical-align: middle;" class="control-label">{{label ? label : 'Textarea'}}</label>
  5. </el-col>
  6. <el-col :span="14">
  7. <el-input
  8. type="textarea"
  9. v-model="textarea"
  10. :placeholder="placeholder ? placeholder : ''"
  11. :disabled="disabled ? true : false"
  12. :name="name ? name : 'textarea'"
  13. :minlength="minlength ? parseInt(minlength) : 0"
  14. :maxlength="maxlength ? parseInt(maxlength) : 5000"
  15. :rows="rows ? parseInt(rows) : 2"
  16. :autosize="autosize ? autosize : false"
  17. :auto-complete="autoComplete ? 'on' : 'off'"
  18. :readonly="readonly ? true : false"
  19. :resize="resize ? resize : 'vertical'"
  20. :autofocus="autofocus ? true : false">
  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','rows','autosize','readonly','resize','autofocus','autoComplete','tips'],
  35. data() {
  36. return {
  37. textarea: this.value ? this.value : ''
  38. };
  39. },
  40. mounted() {
  41. },
  42. methods: {
  43. }
  44. }
  45. </script>
  46. <style scoped>
  47. .classJs {
  48. margin-left: 10px;
  49. vertical-align: middle;
  50. height:42px;
  51. line-height:42px;
  52. }
  53. .red{
  54. color: red;
  55. }
  56. </style>