0

I've been bashing my head against this for 9 hours now. How do I use a directive inside a component?

I'm trying to implement a click-outside event on my clickable components, following this thread. But my component is in a separate .vue file with template, etc, and I have been googling and throwing copy pasted code at it for hours and I just can't get it to work. It either can't find the imported file, or can't find the click-away function, or all sorts of crazy compile errors or runtime errors.

I'm still somewhat new to Vue, but what's the standard way of using a directive in a component? I thought it would be super simple, but I've got hundreds of tabs open and every single possible google link is purple, and nothing works. How are directives even possible if no ones using them with components?

0 Answers0