Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

When using the vueify package, is there a way I can include a directive inside my SomeComponent.vue file? It's a directive used only for that component. I tried including it inside the script tags outside the export default { ... } but it doesn't seem to work.

Am I stuck having all the directives in my main app.js file where I create the Vue instance?

share|improve this question
up vote 0 down vote accepted

The docs show that you can include local directives using the directives option. I tried that and it worked fine.

share|improve this answer
    
How did you made it? If i try it with directive(demo): { bind: function () { console.log('demo bound!') } }, The compiler gives me an unexpected token error. – bobbybackblech Apr 10 at 16:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.