A
A
AL_32018-04-02 15:13:12
JavaScript
AL_3, 2018-04-02 15:13:12

What to use: computed properties or methods?

Welcome all.
I have a textarea and a div above the textarea. The textarea expands as you type and pushes the div up. To organize this using Vue.js, I hung an EventListener in mounted , which reacts to textarea extensions and fires the resize method in methods. The resize method recalculates the height of the textarea and pushes the div up, increasing its bottom. Did I do the right thing, maybe I should use computed properties? If so, how to do it if the height of the textarea and bottom div are unknown in advance (I calculate them in mounted because I want it to look good on all screens).
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
forspamonly2, 2018-04-02
@AL_3

if the input field is already stretched, then the rest of the layout is easier to do without scripts. like flexbox.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question