Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

222
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!