Showing
3 changed files
with
8 additions
and
5 deletions
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-08-29 14:31:20 | 2 | * @Date: 2022-08-29 14:31:20 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2022-08-30 10:40:33 | 4 | + * @LastEditTime: 2022-09-08 14:27:56 |
| 5 | * @FilePath: /data-table/src/components/TextareaField/index.vue | 5 | * @FilePath: /data-table/src/components/TextareaField/index.vue |
| 6 | * @Description: 多行文本输入框 | 6 | * @Description: 多行文本输入框 |
| 7 | --> | 7 | --> |
| ... | @@ -9,7 +9,8 @@ | ... | @@ -9,7 +9,8 @@ |
| 9 | <div class="textarea-field-page"> | 9 | <div class="textarea-field-page"> |
| 10 | <div class="label">{{ item.label }}<span v-if="item.required"> *</span></div> | 10 | <div class="label">{{ item.label }}<span v-if="item.required"> *</span></div> |
| 11 | <van-field v-model="item.value" :name="item.name" :type="item.type" :placeholder="item.placeholder" | 11 | <van-field v-model="item.value" :name="item.name" :type="item.type" :placeholder="item.placeholder" |
| 12 | - :rules="item.rules" :required="item.required" :rows="item.rows" :autosize="item.autosize" /> | 12 | + :rules="item.rules" :required="item.required" :rows="item.component_props.rows" |
| 13 | + autosize :maxlength="item.component_props.maxlength" show-word-limit /> | ||
| 13 | </div> | 14 | </div> |
| 14 | </template> | 15 | </template> |
| 15 | 16 | ... | ... |
| ... | @@ -44,7 +44,7 @@ export function createComponentType(data) { | ... | @@ -44,7 +44,7 @@ export function createComponentType(data) { |
| 44 | if (item.component_props.name === 'textarea') { | 44 | if (item.component_props.name === 'textarea') { |
| 45 | item.type = 'textarea'; | 45 | item.type = 'textarea'; |
| 46 | item.name = item.key; | 46 | item.name = item.key; |
| 47 | - item.rows = 2; | 47 | + // item.rows = 10; |
| 48 | item.autosize = true; | 48 | item.autosize = true; |
| 49 | item.component = TextareaField; | 49 | item.component = TextareaField; |
| 50 | } | 50 | } | ... | ... |
| 1 | <!-- | 1 | <!-- |
| 2 | * @Date: 2022-07-18 10:22:22 | 2 | * @Date: 2022-07-18 10:22:22 |
| 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com | 3 | * @LastEditors: hookehuyr hookehuyr@gmail.com |
| 4 | - * @LastEditTime: 2022-09-08 13:38:52 | 4 | + * @LastEditTime: 2022-09-08 14:31:33 |
| 5 | * @FilePath: /data-table/src/views/index.vue | 5 | * @FilePath: /data-table/src/views/index.vue |
| 6 | * @Description: 首页 | 6 | * @Description: 首页 |
| 7 | --> | 7 | --> |
| ... | @@ -128,7 +128,9 @@ onMounted(() => { | ... | @@ -128,7 +128,9 @@ onMounted(() => { |
| 128 | // placeholder: '请输入留言', | 128 | // placeholder: '请输入留言', |
| 129 | // component: '', | 129 | // component: '', |
| 130 | // component_props: { | 130 | // component_props: { |
| 131 | - // name: 'textarea' | 131 | + // name: 'textarea', |
| 132 | + // rows: 3, | ||
| 133 | + // maxlength: null, | ||
| 132 | // }, | 134 | // }, |
| 133 | // }, | 135 | // }, |
| 134 | // { | 136 | // { | ... | ... |
-
Please register or login to post a comment