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

250
Visualizações
Vue.js inputmask hide placeholder after clicking outside input
  • Im working on a vue project and i have one component that is a numeric input like so :
<template>
   <input
      v-regex="regex"
      type="text"
   />
</template>
  • the v-regex directive is created with inputmask like so :
Vue.directive('regex', {
         bind(element, binding) {
            inputMask({
               regex: binding.value,
               placeholder: '',
               showMaskOnHover: false,
               showMaskOnFocus: false,
               clearMaskOnLostFocus: false,
            }).mask(element)
         },
      })

-and the component is used inside a form like this :

<myComponent
 id="myId"
 class="my-class"
 :placeholder="'write Number'"
/>

the problem im having is : when i click inside the input and then outside it the placeholder "write Number" disappear and never show again unless i refresh the page , is there a way to fix this ? thank you

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

0

You are using the placeholder property of the inputMask component, see documentation here. This is different functionality, that placeholder is for digits for example. If you put that placeholder directly on the <input> tag it will work like you expect it to work.

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