Question · Vue.js course · Module 14: Directives & Plugins

Global directive registration

How do you register a directive globally in Vue?

Answer options

  • app.component('focus', {...})
  • app.directive('focus', {...})
  • app.use('focus', {...})
  • Vue.register('focus', {...})

You can check the correct answer by solving this task in the CodeWorlds game.