Timeline for Adding eventListener to blur event on custom component?
Current License: CC BY-SA 4.0
9 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jul 15, 2022 at 20:09 | history | edited | tony19 | CC BY-SA 4.0 |
updated docs link
|
Feb 22, 2019 at 1:03 | comment | added | Alexey Sh. |
vnode.componentInstance is not defined in directive :)
|
|
Mar 16, 2018 at 2:47 | comment | added | acdcjunior |
You may need to. There are other different methods in the API that may handle your use case: $once() and $off() . See docs: vuejs.org/v2/api/#Instance-Methods-Events
|
|
Mar 16, 2018 at 2:40 | comment | added | David Alsh |
Yes that is exactly what I wanted. Thanks man. Last question, with vnode.componentInstance.$on do you need to manually remove the listener? (just like you do with removeEventListener
|
|
Mar 16, 2018 at 2:37 | comment | added | acdcjunior |
It depends. Inside the component, you can't tell if the parent used v-model or simply :value (because v-model is just a shorthand/syntactic sugar for :value +@input ). Anyway, what I think you want is vnode.componentInstance.$props , is it?
|
|
Mar 16, 2018 at 2:20 | comment | added | David Alsh |
Just a follow up question to this. How do I access the current value of the component's v-model from inside the directive?
|
|
Mar 16, 2018 at 2:11 | vote | accept | David Alsh | ||
Mar 16, 2018 at 2:05 | history | edited | acdcjunior | CC BY-SA 3.0 |
added 1218 characters in body
|
Mar 16, 2018 at 1:41 | history | answered | acdcjunior | CC BY-SA 3.0 |