A
A
alaskafx2022-03-29 16:13:36
Vue.js
alaskafx, 2022-03-29 16:13:36

How to get the height of an element in the element itself via :style?

I have an element:

<div class="info" @click="actuallyPicker === item ?  actuallyPicker = null : actuallyPicker = item" :style="{ height: actuallyPicker === item ? $el.offsetHeight : '' }" v-for="(item, index) in designerButtons" :key="index">


When actuallyPicker becomes the desired object, then the .info element should apply itself to the height of the content within it.
In the code above, I tried to do it through $el.offsetHeight, but this option turned out to be inoperative.

How to do this?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question