From 84f6883e71f300be05247e178c6adfeda7ccb214 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sat, 6 Feb 2021 16:35:08 +0800 Subject: [PATCH] support changing textarea height automatically in account/category edit page --- src/views/mobile/accounts/Edit.vue | 19 +++++++++++++++++++ src/views/mobile/categories/Edit.vue | 15 +++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/src/views/mobile/accounts/Edit.vue b/src/views/mobile/accounts/Edit.vue index 68e30ef5..5adc0b34 100644 --- a/src/views/mobile/accounts/Edit.vue +++ b/src/views/mobile/accounts/Edit.vue @@ -142,6 +142,8 @@ { + el.scrollTop = 0; + el.style.height = ''; + el.style.height = el.scrollHeight + 'px'; + }); + }, chooseSuitableIcon(oldCategory, newCategory) { const allCategories = this.$constants.account.allCategories; diff --git a/src/views/mobile/categories/Edit.vue b/src/views/mobile/categories/Edit.vue index e0249d01..84a840a0 100644 --- a/src/views/mobile/categories/Edit.vue +++ b/src/views/mobile/categories/Edit.vue @@ -66,6 +66,8 @@ { + el.scrollTop = 0; + el.style.height = ''; + el.style.height = el.scrollHeight + 'px'; + }); } } }