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

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

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 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!