Assets

directives

  • Type: Object

  • Details:

    A hash of directives to be made available to the component instance.

  • Usage:

    const app = createApp({})
    
    app.component('focused-input', {
      directives: {
        focus: {
          mounted(el) {
            el.focus()
          }
        }
      },
      template: `<input v-focus>`
    })
  • See also: Custom Directives

components

  • Type: Object

  • Details:

    A hash of components to be made available to the component instance.

  • Usage:

    const Foo = {
      template: `<div>Foo</div>`
    }
    
    const app = createApp({
      components: {
        Foo
      },
      template: `<Foo />`
    })
  • See also: Components

© 2013–present Yuxi Evan You
Licensed under the MIT License.
https://v3.vuejs.org/api/options-assets.html