Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/api/options-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,22 @@

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

- **Usage:**
```js
const app = Vue.createApp({})

app.component('focused-input', {
directives: {
focus: {
mounted(el) {
el.focus()
}
}
},
template: `<input v-focus>`
})
```

- **See also:** [Custom Directives](../guide/custom-directive.html)

## components
Expand All @@ -18,4 +34,18 @@

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

- **Usage:**
```js
const Foo = {
template: `<div>Foo</div>`
}

const app = Vue.createApp({
components: {
Foo
},
template: `<Foo />`
})
```

- **See also:** [Components](../guide/component-basics.html)