# 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>`
    })
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
  • 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 />`
    })
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
  • See also: Components

Deployed on Netlify.
Last updated: 2021-05-06, 06:55:34 UTC