|
| 1 | +<!-- |
| 2 | + - MIT License |
| 3 | + - |
| 4 | + - Copyright (c) 2018 Darren Fang |
| 5 | + - |
| 6 | + - Permission is hereby granted, free of charge, to any person obtaining a copy |
| 7 | + - of this software and associated documentation files (the "Software"), to deal |
| 8 | + - in the Software without restriction, including without limitation the rights |
| 9 | + - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 10 | + - copies of the Software, and to permit persons to whom the Software is |
| 11 | + - furnished to do so, subject to the following conditions: |
| 12 | + - |
| 13 | + - The above copyright notice and this permission notice shall be included in all |
| 14 | + - copies or substantial portions of the Software. |
| 15 | + - |
| 16 | + - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 17 | + - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 18 | + - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 19 | + - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 20 | + - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 21 | + - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 22 | + - SOFTWARE. |
| 23 | + - |
| 24 | + --> |
| 25 | + |
| 26 | +<template> |
| 27 | + <div> |
| 28 | + <v-textarea |
| 29 | + :value="displayText" |
| 30 | + :label="label" |
| 31 | + :hint="hint" |
| 32 | + :persistent-hint="persistentHint" |
| 33 | + :loading="loading" |
| 34 | + :counter="counter" |
| 35 | + :rows="rows" |
| 36 | + readonly |
| 37 | + disabled |
| 38 | + auto-grow |
| 39 | + class="v-static-textarea" |
| 40 | + > |
| 41 | + <template v-slot:progress> |
| 42 | + <v-progress-linear |
| 43 | + :indeterminate="true" |
| 44 | + :color="progressColor" |
| 45 | + :height="progressHeight" |
| 46 | + > |
| 47 | + </v-progress-linear> |
| 48 | + </template> |
| 49 | + </v-textarea> |
| 50 | + </div> |
| 51 | +</template> |
| 52 | + |
| 53 | +<script> |
| 54 | + export default { |
| 55 | + name: 'v-static-textarea', |
| 56 | + props: { |
| 57 | + label: { |
| 58 | + type: String |
| 59 | + }, |
| 60 | + value: { |
| 61 | + required: true |
| 62 | + }, |
| 63 | + hint: { |
| 64 | + type: String |
| 65 | + }, |
| 66 | + counter: { |
| 67 | + type: Boolean |
| 68 | + }, |
| 69 | + rows: { |
| 70 | + type: [Number, String] |
| 71 | + }, |
| 72 | + persistentHint: { |
| 73 | + type: Boolean |
| 74 | + }, |
| 75 | + loading: { |
| 76 | + type: Boolean |
| 77 | + }, |
| 78 | + progressColor: { |
| 79 | + type: String, |
| 80 | + default: 'primary' |
| 81 | + }, |
| 82 | + progressHeight: { |
| 83 | + type: Number, |
| 84 | + default: 3 |
| 85 | + } |
| 86 | + }, |
| 87 | + computed: { |
| 88 | + displayText: function () { |
| 89 | + return this.loading ? '' : this.value |
| 90 | + } |
| 91 | + } |
| 92 | + } |
| 93 | +</script> |
0 commit comments