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

897
Views
Pase el mouse o pase el mouse sobre vue.js

Me gustaría mostrar un div al pasar el mouse sobre un elemento en vue.js. Pero parece que no puedo hacerlo funcionar.

Parece que no hay ningún evento para hover el mouse por encima o por encima del mouse en mouseover ¿Es esto realmente cierto?

¿Sería posible combinar los métodos jquery hover y vue?

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Siento que la lógica superior para hover es incorrecta. simplemente se invierte cuando el mouse se desplaza. He usado el siguiente código. parece funcionar perfectamente bien.

 <div @mouseover="upHere = true" @mouseleave="upHere = false" > <h2> Something Something </h2> <some-component v-show="upHere"></some-component> </div>

en la instancia de vue

 data : { upHere : false }

Espero que ayude

over 4 years ago · Santiago Trujillo Report

0

Aquí hay un ejemplo práctico de lo que creo que estás pidiendo.

http://jsfiddle.net/1cekfnqw/3017/

 <div id="demo"> <div v-show="active">Show</div> <div @mouseover="mouseOver">Hover over me!</div> </div> var demo = new Vue({ el: '#demo', data: { active: false }, methods: { mouseOver: function(){ this.active = !this.active; } } });
over 4 years ago · Santiago Trujillo Report

0

No hay necesidad de un método aquí.

HTML

 <div v-if="active"> <h2>Hello World!</h2> </div> <div v-on:mouseover="active = !active"> <h1>Hover me!</h1> </div>

JS

 new Vue({ el: 'body', data: { active: false } })
over 4 years ago · Santiago Trujillo 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!