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

193
Visualizações
Fit width of absolute element to content

I am trying to customize the tooltip's width of element-ui framework because text inside tooltip is broken incorrectly.

Here is generated tooltip element with is placed on the bottom of body tag

<div role="tooltip" id="el-tooltip-8061" aria-hidden="true" class="el-tooltip__popper is-dark popper-width" style="transform-origin: center top;z-index: 2031;/* display: none; */">
   <div data-v-65209316="" class="row">
      <div data-v-65209316="" class="col-5">Employee</div>
      <div data-v-65209316="" class="col-7">John Smith</div>
   </div>
   <div x-arrow="" class="popper__arrow" style="left: 77px;"></div>
</div>

and here is my vue code:

<el-tooltip placement="bottom" theme="dark" popper-class="popper-width" :popper-options="customPopperOptions">
    <template slot="content">
        <div class="row">
            <div class="col-5">
                Employee
            </div>
            <div class="col-7">
                John Smith
            </div>
        </div>
    </template>
</el-tooltip>

and

customPopperOptions() {
  return {container: document.body, boundariesElement: document.body}
}

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I see you are using bootstrap classes, have you thought about splitting them out because your 12 grid has less space to occupy on your employee tooltip. 1st off, try evening them out:

       <div class="row">
            <div class="col-6">
                Employee
            </div>
            <div class="col-6">
                John Smith
            </div>
        </div

See if that works, should split the difference. If this causes issues then you will probably need to adjust your CSS code because it looks as though your class .popper-width has a set width.

about 4 years ago · Juan Pablo Isaza Relatório
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