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

217
Visualizações
Why the function that inside the v-hover is called every times whenever hovering

Whenever hovering on the v-sheet, getBlueColor() function that is inside the v-hover is called. why it happened like that?

exemple code

<template>
  <v-row justify="center" align="center">
    <v-hover v-slot="{ hover }">
      <v-sheet width="100" height="100" style="border: white" :style="hover ? 'background-color: white' : ''">
        <span :style="getRedColor()"> why </span>
      </v-sheet>
    </v-hover>
  </v-row>
</template>

<script>
import { defineComponent } from '@vue/composition-api'

export default defineComponent({
  methods: {
    test() {
      console.log('test')
    },
    getBlueColor() {
      console.log('Call function')
      return 'color:blue;'
    },
  },
})
</script>

And It is result after 5times hovering on the v-sheet

(10) Call function func.getBlueColor

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

0

On top of what was told above, I do recommend the second part of my answer here to have a fully flexible styling (section How I do personally handle this kind of flow)

<button
  class="flex items-center w-auto p-4 text-center ..."
  :class="[
    callToAction.types[color][variant],
    { 'opacity-50 cursor-not-allowed shadow-none': disabled },
  ]"
>
  Nice flexible button
</button>

With a whole CSS object mapped to the received props.
It works even better if you have an utility-first CSS framework, like Tailwind.

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