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

563
Vistas
TypeError: binding.value is not a function Vue js v-click-outside

i am using v-click-outside and want to pass value to the function but i am having error

enter image description here

enter image description here

This is how i am passing a value enter image description here

Here is my code from Main.js file

vue_app.directive('click-outside', {
    beforeMount(el, binding, vnode) {
        el.clickOutsideEvent = evt => {
            evt.stopPropagation()
            if (!(el === evt.target || el.contains(evt.target))) {
                binding.value(evt, el)
            }
        }
        // Wait 1 frame otherwise a potential click that mounted the element will immediately trigger a click-outside event:
        window.requestAnimationFrame(() => {
            document.addEventListener('click', el.clickOutsideEvent)
        })
    },
    unmounted(el) {
        document.removeEventListener('click', el.clickOutsideEvent)
    },
});
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You have to pass a function to the directive, but right now you call it right away and pass the returned value. So instead of

v-click-outside="hideAllShowDetailDropdown(show.show_ID)"

Try this:

v-click-outside="() => hideAllShowDetailDropdown(show.show_ID)"
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