mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 01:34:24 +08:00
support changing textarea height automatically in account/category edit page
This commit is contained in:
@@ -142,6 +142,8 @@
|
|||||||
|
|
||||||
<f7-list-input
|
<f7-list-input
|
||||||
type="textarea"
|
type="textarea"
|
||||||
|
class="textarea-auto-size"
|
||||||
|
style="height: auto"
|
||||||
:placeholder="$t('Your account description (optional)')"
|
:placeholder="$t('Your account description (optional)')"
|
||||||
:value="account.comment"
|
:value="account.comment"
|
||||||
@input="account.comment = $event.target.value"
|
@input="account.comment = $event.target.value"
|
||||||
@@ -192,6 +194,8 @@
|
|||||||
|
|
||||||
<f7-list-input
|
<f7-list-input
|
||||||
type="textarea"
|
type="textarea"
|
||||||
|
class="textarea-auto-size"
|
||||||
|
style="height: auto"
|
||||||
:placeholder="$t('Your account description (optional)')"
|
:placeholder="$t('Your account description (optional)')"
|
||||||
:value="account.comment"
|
:value="account.comment"
|
||||||
@input="account.comment = $event.target.value"
|
@input="account.comment = $event.target.value"
|
||||||
@@ -276,6 +280,8 @@
|
|||||||
|
|
||||||
<f7-list-input
|
<f7-list-input
|
||||||
type="textarea"
|
type="textarea"
|
||||||
|
class="textarea-auto-size"
|
||||||
|
style="height: auto"
|
||||||
:placeholder="$t('Your sub account description (optional)')"
|
:placeholder="$t('Your sub account description (optional)')"
|
||||||
:value="subAccount.comment"
|
:value="subAccount.comment"
|
||||||
@input="subAccount.comment = $event.target.value"
|
@input="subAccount.comment = $event.target.value"
|
||||||
@@ -435,6 +441,9 @@ export default {
|
|||||||
self.loading = false;
|
self.loading = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
updated: function () {
|
||||||
|
this.autoChangeCommentTextareaSize();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
addSubAccount() {
|
addSubAccount() {
|
||||||
const self = this;
|
const self = this;
|
||||||
@@ -567,6 +576,16 @@ export default {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
autoChangeCommentTextareaSize() {
|
||||||
|
const app = this.$f7;
|
||||||
|
const $$ = app.$;
|
||||||
|
|
||||||
|
$$('.textarea-auto-size textarea').each((idx, el) => {
|
||||||
|
el.scrollTop = 0;
|
||||||
|
el.style.height = '';
|
||||||
|
el.style.height = el.scrollHeight + 'px';
|
||||||
|
});
|
||||||
|
},
|
||||||
chooseSuitableIcon(oldCategory, newCategory) {
|
chooseSuitableIcon(oldCategory, newCategory) {
|
||||||
const allCategories = this.$constants.account.allCategories;
|
const allCategories = this.$constants.account.allCategories;
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,8 @@
|
|||||||
|
|
||||||
<f7-list-input
|
<f7-list-input
|
||||||
type="textarea"
|
type="textarea"
|
||||||
|
class="textarea-auto-size"
|
||||||
|
style="height: auto"
|
||||||
:placeholder="$t('Your category description (optional)')"
|
:placeholder="$t('Your category description (optional)')"
|
||||||
:value="category.comment"
|
:value="category.comment"
|
||||||
@input="category.comment = $event.target.value"
|
@input="category.comment = $event.target.value"
|
||||||
@@ -185,6 +187,9 @@ export default {
|
|||||||
self.loading = false;
|
self.loading = false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
updated: function () {
|
||||||
|
this.autoChangeCommentTextareaSize();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
save() {
|
save() {
|
||||||
const self = this;
|
const self = this;
|
||||||
@@ -235,6 +240,16 @@ export default {
|
|||||||
self.$toast(error.message || error);
|
self.$toast(error.message || error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
autoChangeCommentTextareaSize() {
|
||||||
|
const app = this.$f7;
|
||||||
|
const $$ = app.$;
|
||||||
|
|
||||||
|
$$('.textarea-auto-size textarea').each((idx, el) => {
|
||||||
|
el.scrollTop = 0;
|
||||||
|
el.style.height = '';
|
||||||
|
el.style.height = el.scrollHeight + 'px';
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user