Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

248
Visualizações
Vue.js + Dynamically resize list based on the number of items

I have created a dropdown with input using li. However, the height of the ul is fixed. I want to set the height of ul to set dynamically based on the number of items displayed so that if there are no items in the list the height is less.

enter image description here

 <div class="filterdropdown">
            <input placeholder="Enter a filter name"/>
            <div><img src="../Images/ICE.FilterChevron.png"  @click="filters.isShow = !filters.isShow" /></div>
        </div>
        <div v-if="filters.isShow">
            <ul>
                <li v-on:click="createNew">Create new Filter</li>
                <li v-for="item in filters.entities" v-on:click="filter.changeFilter(item.id,item.name)">{{ item.name }}<div title="Delete filter">x</div></li>
            </ul>
        </div>

CSS

    ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    border: 1px solid #333;
    height: 85px;
    overflow: hidden;
    overflow-y: scroll;
}
about 4 years ago · Santiago Gelvez
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda