Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

216
Vistas
How to capitalize title tooltip in Vue.js

How do I capitalize only the first letter of the title tooltip (from a span)? I tried using CSS text-transform: capitalize;, but it didn't work.

<template lang="pug">
    .cell-audience-status-dot(:class="{'overflow-initial': type === 'actions'}")
        .cell-content.audiences(v-if="data !== 'never_activated'")
            .icon-wrapper(:class="{ active : activeMenu === 'activeSegments' && openedSegments.includes(fullData.id) }")
                span.icon(:title="data" :class="getStatusColor") &#9679;
</template>

<script>
import { get } from 'vuex-pathify'

export default {
    name: 'cellStatus',
    props: ['data', 'type', 'fullData'],
    computed: {
        openedSegments: get('activeSegments/openedSegments'),
        activeMenu: get('menu/activeMenu'),
        getStatusColor() {
            const { data } = this
            if (data === 'active') return 'green'
            else if (data === 'inactive') return 'red'
            else if (data === 'paused') return 'orange'
            return ''
        }
    },
}
</script>
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Create a computed property that returns the capitalized form of data:

export default {
  computed: {
    title() {
      return this.data?.length && this.data[0].toUpperCase() + this.data.slice(1)
    }
  }
}

And instead of data, bind the computed prop to the span's title attribute:

span.icon(:title="title" :class="getStatusColor") &#9679;
                    👆

demo

about 4 years ago · Juan Pablo Isaza Denunciar

0

to capitalize only first letter of a text you can use the css selector :first-letter and text-transform: uppercase;

 .title:first-letter {
     text-transform: uppercase;
 }
<div class="title">my text</div>

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda